<commit_before>var stream = require('../lib/twitter-stream.js');
var testUserConfig = require('../user-config.json');

exports['checkValues'] = function (test) {
    test.notEqual(testUserConfig.twitter.consumer_key.length,0);
    test.notEqual(testUserConfig.twitter.consumer_secret.length,0);
    test.notEqual(testUserConfig.twitter.access_token_key.length,0);
    test.notEqual(testUserConfig.twitter.access_token_secret.length,0);
    test.notEqual(testUserConfig.local.storage.length,0);
    test.notEqual(testUserConfig.local.maxSize.length,0);
    test.done();
};

exports['checkInit'] = function (test) {
  stream.initConfig();
  test.equal(stream.getStorage(),testUserConfig.local.storage);
  test.deepEqual(stream.getConnection(),{
    "consumer_key": testUserConfig.twitter.consumer_key,
    "consumer_secret": testUserConfig.twitter.consumer_secret,
    "access_token_key": testUserConfig.twitter.access_token_key,
    "access_token_secret": testUserConfig.twitter.access_token_secret,
    "stream" : testUserConfig.twitter.streamType.basic,
    "optionalStream": testUserConfig.twitter.streamType.userSpecific
  });
  test.done();
};
exports['fileSize'] = function(test) {

  stream.getCompareFileSize('./testfile.json', "2 MB",function(ret){
    test.equal(ret,0);
  });

  stream.getCompareFileSize('./testfile.json', "10 B",function(ret){
    test.equal(ret,0);
  });

  stream.getCompareFileSize('./user-config.json', "300 B",function(ret){
    test.equal(ret,1);
  });

  test.done();

};<commit_msg>added client test<commit_after>var stream = require('../lib/twitter-stream.js');
var testUserConfig = require('../user-config.json');

exports['checkValues'] = function (test) {
    test.notEqual(testUserConfig.twitter.consumer_key.length,0);
    test.notEqual(testUserConfig.twitter.consumer_secret.length,0);
    test.notEqual(testUserConfig.twitter.access_token_key.length,0);
    test.notEqual(testUserConfig.twitter.access_token_secret.length,0);
    test.notEqual(testUserConfig.local.storage.length,0);
    test.notEqual(testUserConfig.local.maxSize.length,0);
    test.done();
};

exports['checkInit'] = function (test) {
  stream.initConfig();
  test.equal(stream.getStorage(),testUserConfig.local.storage);
  test.deepEqual(stream.getConnection(),{
    "consumer_key": testUserConfig.twitter.consumer_key,
    "consumer_secret": testUserConfig.twitter.consumer_secret,
    "access_token_key": testUserConfig.twitter.access_token_key,
    "access_token_secret": testUserConfig.twitter.access_token_secret,
    "stream" : testUserConfig.twitter.streamType.basic,
    "optionalStream": testUserConfig.twitter.streamType.userSpecific
  });
  test.done();
};
exports['fileSize'] = function(test) {

  stream.getCompareFileSize('./testfile.json', "2 MB",function(ret){
    test.equal(ret,0);
  });

  stream.getCompareFileSize('./testfile.json', "10 B",function(ret){
    test.equal(ret,0);
  });

  stream.getCompareFileSize('./user-config.json', "300 B",function(ret){
    test.equal(ret,1);
  });

  test.done();
};

exports['createClient'] = function(test) {

  function testClient() {
    var client = stream.createClient();
    test.notEqual(typeof client, new Object());
  }

  testClient();
  test.done();
};
{'fraction_non_alphanumeric': 0.16085211485026243, 'fraction_numerical': 0.009262117937635072, 'mean_word_length': 5.315789473684211, 'pattern_counts': {'":': 10, '<': 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': '764332', 'n_tokens_mistral': 1061, 'n_tokens_neox': 1030, 'n_words': 115}