<commit_before>
var fs = require('fs'),
    path = require('path'),
    should = require('should');
var db = require('../../lib/utils/database'),
    Schema = require('../../lib/utils/schema');


describe('schema', function () {
    var schema = null;
    before(function (done) {
        db.connect({user: 'liolio', password: '<PASSWORD>'}, function (err) {
            if (err) return done(err);
            db.use('express-admin-simple', function (err) {
                if (err) return done(err);
                schema = new Schema(db);
                done();
            });
        });
    });

    it('get table names', function (done) {
        schema.getTables(function (err, tables) {
            if (err) return done(err);
            tables.join().should.equal(
                'item,property,purchase,recipe,recipe_ref,recipe_type,subtype,type,user');
            done();
        });
    });
    it('get table columns info', function (done) {
        schema.getTables(function (err, tables) {
            if (err) return done(err);
            schema.getColumns(tables[0], function (err, info) {
                if (err) return done(err);
                var columns = Object.keys(info);
                columns.join().should.equal('id,name,notes');
                // may test column properties too
                done();
            });
        });
    });
    it('get schema columns info', function (done) {
        schema.getAllColumns(function (err, columns) {
            if (err) return done(err);
            var tables = Object.keys(columns);
            tables.join().should.equal(
                'item,property,purchase,recipe,recipe_ref,recipe_type,subtype,type,user');
            done();
        });
    });
    it('get schema references', function (done) {
        schema.getReferences(function (err, ref) {
            if (err) return done(err);
            var tables = Object.keys(ref);
            should.deepEqual(tables, ['purchase','property','recipe','recipe_ref','type']);
            // may test column properties too
            done();
        });
    });
    it('get table indexes', function (done) {
        schema.getIndexes('purchase', function (err, indexes) {
            if (err) return done(err);
            Object.keys(indexes).join()
                .should.equal('PRIMARY,fk_purchase_user_idx,fk_purchase_item1_idx');<commit_msg>Test fix for Travis CI<commit_after>
var fs = require('fs'),
    path = require('path'),
    should = require('should');
var db = require('../../lib/utils/database'),
    Schema = require('../../lib/utils/schema');


describe('schema', function () {
    var schema = null;
    before(function (done) {
        db.connect({user: 'liolio', password: '<PASSWORD>'}, function (err) {
            if (err) return done(err);
            db.use('express-admin-simple', function (err) {
                if (err) return done(err);
                schema = new Schema(db);
                done();
            });
        });
    });

    it('get table names', function (done) {
        schema.getTables(function (err, tables) {
            if (err) return done(err);
            tables.join().should.equal(
                'item,property,purchase,recipe,recipe_ref,recipe_type,subtype,type,user');
            done();
        });
    });
    it('get table columns info', function (done) {
        schema.getTables(function (err, tables) {
            if (err) return done(err);
            schema.getColumns(tables[0], function (err, info) {
                if (err) return done(err);
                var columns = Object.keys(info);
                columns.join().should.equal('id,name,notes');
                // may test column properties too
                done();
            });
        });
    });
    it('get schema columns info', function (done) {
        schema.getAllColumns(function (err, columns) {
            if (err) return done(err);
            var tables = Object.keys(columns);
            tables.join().should.equal(
                'item,property,purchase,recipe,recipe_ref,recipe_type,subtype,type,user');
            done();
        });
    });
    it('get schema references', function (done) {
        schema.getReferences(function (err, ref) {
            if (err) return done(err);
            var tables = Object.keys(ref);
            should.deepEqual(tables, ['property','purchase','recipe','recipe_ref','type']);
            // may test column properties too
            done();
        });
    });
    it('get table indexes', function (done) {
        schema.getIndexes('purchase', function (err, indexes) {
            if (err) return done(err);
            Object.keys(indexes).join()
                .should.equal('PRIMARY,fk_purchase_user_idx,fk_purchase_item1_idx');
{'fraction_non_alphanumeric': 0.1523331240845365, 'fraction_numerical': 0.0008369951872776732, 'mean_word_length': 1.9893683552220138, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1265227', 'n_tokens_mistral': 1343, 'n_tokens_neox': 1304, 'n_words': 291}