<commit_before>/*global describe, define, beforeEach, it, expect*/
define(['db-connector', 'q'], function (DBCONNECTOR, Q) {

    'use strict';

    var c;

    beforeEach(function () {
        c = new DBCONNECTOR();
    });

    describe('DB CONNECTOR', function () {

        describe('Configurability', function () {

            it('The simulator should have 2 urls', function () {
                expect(Object.keys(s.CONFIG.urls).length).toEqual(2);
            });

            it('One for testing...', function () {
                expect(s.CONFIG.urls.test).not.toBeUndefined();
            });

            it('...and one for production.', function () {
                expect(s.CONFIG.urls.production).not.toBeUndefined();
            });

        });

        describe('Get Elevators by session and time', function () {

            it('The connector refuses invalid environments.', function () {
                expect(function () {
                    c.get_by_session_and_time('deploy', 'alpha', 1);
                }).toThrowError('Please provide a valid environment ("test" or "production").');
            });

        });

        describe('Create an elevator', function () {

            var elevator_1 = {
                "id": "A",
                "session": "alpha",
                "time": 1,
                "floor": 1,
                "people": 0,
                "direction": "stationary",
                "stops": []<commit_msg>Test persistence.<commit_after>/*global describe, define, beforeEach, it, expect*/
define(['db-connector', 'q'], function (DBCONNECTOR, Q) {

    'use strict';

    var c;

    beforeEach(function () {
        c = new DBCONNECTOR();
    });

    describe('DB CONNECTOR', function () {

        describe('Configurability', function () {

            it('The simulator should have 2 urls', function () {
                expect(Object.keys(c.CONFIG.urls).length).toEqual(2);
            });

            it('One for testing...', function () {
                expect(c.CONFIG.urls.test).not.toBeUndefined();
            });

            it('...and one for production.', function () {
                expect(c.CONFIG.urls.production).not.toBeUndefined();
            });

        });

        describe('Get Elevators by session and time', function () {

            it('The connector refuses invalid environments.', function () {
                expect(function () {
                    c.get_by_session_and_time('deploy', 'alpha', 1);
                }).toThrowError('Please provide a valid environment ("test" or "production").');
            });

            it('The connector should retrieve data from the DB.', function () {
                c.get_by_session_and_time('deploy', 'alpha', 1).success(function (response) {
                    console.log(response);
                }).fail(function (error) {
                    console.log(error);
                });
            });

        });

        describe('Create an elevator', function () {

            var elevator_1 = {
                "id": "A",
                "session": "alpha",
                "time": 1,
                "floor": 1,
                "people": 0,
                "direction": "stationary",
                "stops": []
{'fraction_non_alphanumeric': 0.14878573624346758, 'fraction_numerical': 0.0046111281893636644, 'mean_word_length': 1.6178600160901047, 'pattern_counts': {'":': 14, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '103173', 'n_tokens_mistral': 874, 'n_tokens_neox': 805, 'n_words': 192}