<commit_before>var stub         = require('../../fixtures/stub'),
    Plugin       = require('../../fixtures/stub_plugin'),
    Connection   = require('../../fixtures/stub_connection'),
    configfile   = require('../../../configfile'),
    config       = require('../../../config');

function _set_up(callback) {
    this.backup = {};

    // needed for tests
    this.plugin = Plugin('auth/auth_vpopmaild');
    this.plugin.inherits('auth/auth_base');
    this.plugin.config = config;
    this.plugin.cfg = config.get('auth_vpopmaild.ini');

    // stub out functions
    this.connection = Connection.createConnection();
    // this.connection.results = new ResultStore(this.connection);
    this.connection.notes = {};
    this.connection.capabilities=null;

    callback();
}

function _tear_down(callback) {
    callback();
}

exports.hook_capabilities = {
    setUp : _set_up,
    tearDown : _tear_down,
    'no TLS': function (test) {
        var cb = function (rc, msg) {
            test.expect(3);
            test.equal(undefined, rc);
            test.equal(undefined, msg);
            test.equal(null, this.connection.capabilities);
            test.done();
        }.bind(this);
        this.plugin.hook_capabilities(cb, this.connection);
    },
    'with TLS': function (test) {
        var cb = function (rc, msg) {
            test.expect(3);
            test.equal(undefined, rc);
            test.equal(undefined, msg);
            test.ok(this.connection.capabilities.length);
            // console.log(this.connection.capabilities);
            test.done();
        }.bind(this);
        this.connection.using_tls=true;
        this.connection.capabilities=[];
        this.plugin.hook_capabilities(cb, this.connection);
    },
    'with TLS, sysadmin': function (test) {
        var cb = function (rc, msg) {
            test.expect(3);
            test.equal(undefined, rc);
            test.equal(undefined, msg);
            test.ok(this.connection.capabilities.length);
            // console.log(this.connection.capabilities);
            test.done();
        }.bind(this);
        this.connection.using_tls=true;
        this.connection.capabilities=[];
        this.plugin.hook_capabilities(cb, this.connection);
    },
};

exports.get_vpopmaild_socket = {
    setUp : _set_up,
    tearDown : _tear_down,
    'any': function (test) {
        test.expect(1);
        var socket = this.plugin.get_vpopmaild_socket('<EMAIL>');
        // console.log(socket);
        test.ok(socket);
        socket.end();
        test.done();
    }
};

exports.get_plain_passwd = {
    setUp : _set_up,
    tearDown : _tear_down,
    '<EMAIL>': function (test) {
        var cb = function(pass) {
            test.expect(1);
            test.ok(pass);
            test.done();
        };
        if (this.plugin.cfg['example.com'].sysadmin) {
            this.plugin.get_plain_passwd('<EMAIL>', cb);
        }
        else {
            test.expect(0);
            test.done();
        }
    }
};

exports.check_plain_passwd = {
    setUp : _set_up,
    tearDown : _tear_down,
    'any': function (test) {
        var cb = function(result) {
            test.expect(1);
            if (result) {
                test.ok(result);
            }
            else {
                test.ok(1);  // TODO, find a way to test
            }
            test.done();
        };
        this.plugin.check_plain_passwd(this.connection, '<EMAIL>', '<PASSWORD>ret', cb);
    }
};<commit_msg>auth_vpopmaild: removed an incomplete test<commit_after>var stub         = require('../../fixtures/stub'),
    Plugin       = require('../../fixtures/stub_plugin'),
    Connection   = require('../../fixtures/stub_connection'),
    configfile   = require('../../../configfile'),
    config       = require('../../../config');

function _set_up(callback) {
    this.backup = {};

    // needed for tests
    this.plugin = Plugin('auth/auth_vpopmaild');
    this.plugin.inherits('auth/auth_base');
    this.plugin.config = config;
    this.plugin.cfg = config.get('auth_vpopmaild.ini');

    // stub out functions
    this.connection = Connection.createConnection();
    // this.connection.results = new ResultStore(this.connection);
    this.connection.notes = {};
    this.connection.capabilities=null;

    callback();
}

function _tear_down(callback) {
    callback();
}

exports.hook_capabilities = {
    setUp : _set_up,
    tearDown : _tear_down,
    'no TLS': function (test) {
        var cb = function (rc, msg) {
            test.expect(3);
            test.equal(undefined, rc);
            test.equal(undefined, msg);
            test.equal(null, this.connection.capabilities);
            test.done();
        }.bind(this);
        this.plugin.hook_capabilities(cb, this.connection);
    },
    'with TLS': function (test) {
        var cb = function (rc, msg) {
            test.expect(3);
            test.equal(undefined, rc);
            test.equal(undefined, msg);
            test.ok(this.connection.capabilities.length);
            // console.log(this.connection.capabilities);
            test.done();
        }.bind(this);
        this.connection.using_tls=true;
        this.connection.capabilities=[];
        this.plugin.hook_capabilities(cb, this.connection);
    },
    'with TLS, sysadmin': function (test) {
        var cb = function (rc, msg) {
            test.expect(3);
            test.equal(undefined, rc);
            test.equal(undefined, msg);
            test.ok(this.connection.capabilities.length);
            // console.log(this.connection.capabilities);
            test.done();
        }.bind(this);
        this.connection.using_tls=true;
        this.connection.capabilities=[];
        this.plugin.hook_capabilities(cb, this.connection);
    },
};

exports.get_vpopmaild_socket = {
    setUp : _set_up,
    tearDown : _tear_down,
    'any': function (test) {
        test.expect(1);
        var socket = this.plugin.get_vpopmaild_socket('<EMAIL>');
        // console.log(socket);
        test.ok(socket);
        socket.end();
        test.done();
    }
};

exports.get_plain_passwd = {
    setUp : _set_up,
    tearDown : _tear_down,
    '<EMAIL>': function (test) {
        var cb = function(pass) {
            test.expect(1);
            test.ok(pass);
            test.done();
        };
        if (this.plugin.cfg['example.com'].sysadmin) {
            this.plugin.get_plain_passwd('<EMAIL>', cb);
        }
        else {
            test.expect(0);
            test.done();
        }
    }
};
{'fraction_non_alphanumeric': 0.15124636794616914, 'fraction_numerical': 0.0021410001529285822, 'mean_word_length': 1.997250229147571, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '232586', 'n_tokens_mistral': 1978, 'n_tokens_neox': 1970, 'n_words': 322}