<commit_before>var assert = require('assert')
  , fs = require('fs')
  , http = require('http')
  , path = require('path')
  , uuid = require('node-uuid')
  , request = require('request')
  , Framer = require('..')
  ;

describe('test image downloads', function () {
  var prefix = 'prefix',
      uid = uuid.v1(),
      maxAge = 3600;

  var s3Options = {
    secure: false,
    key: 'bogus',
    secret: 'bogus',
    bucket: 'bogus'
  };

  var s3Client = {
    get: function (imagePath) {
      var expectedPath = '/' + prefix + '/' + uid + '/file.txt';

      var mock = {};
      mock.on = function (evt, cb) {
        if (evt === 'response') {
          if (imagePath === expectedPath) {
            var obj = fs.createReadStream(path.join(__dirname, 'file.txt'));
            obj.statusCode = 200;
            obj.headers = {};
            obj.headers['content-type'] = 'text/html';
            obj.headers['content-length'] = 24;
            cb(obj);
          }
          else {
            cb({ statusCode: 403, on: function (){} });
          }
        }
        return mock;
      };
      mock.end = function () {};
      return mock;
    }
  };

  var PORT = Math.ceil(Math.random()*2000 + 1024);
  var framer = new Framer({
    s3: s3Options
  });
  framer._s3Client = s3Client;
<commit_msg>Taking out content-length for now<commit_after>var assert = require('assert')
  , fs = require('fs')
  , http = require('http')
  , path = require('path')
  , uuid = require('node-uuid')
  , request = require('request')
  , Framer = require('..')
  ;

describe('test image downloads', function () {
  var prefix = 'prefix',
      uid = uuid.v1(),
      maxAge = 3600;

  var s3Options = {
    secure: false,
    key: 'bogus',
    secret: 'bogus',
    bucket: 'bogus'
  };

  var s3Client = {
    get: function (imagePath) {
      var expectedPath = '/' + prefix + '/' + uid + '/file.txt';

      var mock = {};
      mock.on = function (evt, cb) {
        if (evt === 'response') {
          if (imagePath === expectedPath) {
            var obj = fs.createReadStream(path.join(__dirname, 'file.txt'));
            obj.statusCode = 200;
            obj.headers = {};
            obj.headers['content-type'] = 'text/html';
            cb(obj);
          }
          else {
            cb({ statusCode: 403, on: function (){} });
          }
        }
        return mock;
      };
      mock.end = function () {};
      return mock;
    }
  };

  var PORT = Math.ceil(Math.random()*2000 + 1024);
  var framer = new Framer({
    s3: s3Options
  });
  framer._s3Client = s3Client;

{'fraction_non_alphanumeric': 0.168343653250774, 'fraction_numerical': 0.020123839009287926, 'mean_word_length': 1.967853042479908, 'pattern_counts': {'":': 0, '<': 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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1523306', 'n_tokens_mistral': 875, 'n_tokens_neox': 835, 'n_words': 190}