<commit_before>'use strict';

var request = require('supertest');
var CluestrProvider = require('cluestr-provider');
require('should');

var config = require('../config/configuration.js');
var serverConfig = require('../lib/provider-google-contact');



describe("Workflow", function () {
// Create a fake HTTP server
  process.env.CLUESTR_SERVER = 'http://localhost:1337';

  // Create a fake HTTP server
  var frontServer = CluestrProvider.debug.createTestApiServer();
  frontServer.listen(1337);

  before(function(done) {
    CluestrProvider.debug.createToken({
      cluestrToken: '<PASSWORD>',
      datas: config.test_refresh_token,
      cursor: new Date(1970)
    }, done);
  });

  it("should upload datas to Cluestr", function (done) {
    var originalQueueWorker = serverConfig.queueWorker;
    serverConfig.queueWorker = function(task, cluestrClient, refreshToken, cb) {
      task.should.have.property('url');
      task.should.have.property('id');

      originalQueueWorker(task, cluestrClient, refreshToken, cb);
    };
    var server = CluestrProvider.createServer(serverConfig);

    server.queue.drain = function() {
      done();
    };

    request(server)
      .post('/update')
      .send({
        access_token: 'fake_gc_access_token'
      })
      .expect(204)
      .end(function(err) {
        if(err) {
          throw err;
        }
      });
  });
});<commit_msg>202 instead of 204<commit_after>'use strict';

var request = require('supertest');
var CluestrProvider = require('cluestr-provider');
require('should');

var config = require('../config/configuration.js');
var serverConfig = require('../lib/provider-google-contact');



describe("Workflow", function () {
// Create a fake HTTP server
  process.env.CLUESTR_SERVER = 'http://localhost:1337';

  // Create a fake HTTP server
  var frontServer = CluestrProvider.debug.createTestApiServer();
  frontServer.listen(1337);

  before(function(done) {
    CluestrProvider.debug.createToken({
      cluestrToken: '<PASSWORD>',
      datas: config.test_refresh_token,
      cursor: new Date(1970)
    }, done);
  });

  it("should upload datas to Cluestr", function (done) {
    var originalQueueWorker = serverConfig.queueWorker;
    serverConfig.queueWorker = function(task, cluestrClient, refreshToken, cb) {
      task.should.have.property('url');
      task.should.have.property('id');

      originalQueueWorker(task, cluestrClient, refreshToken, cb);
    };
    var server = CluestrProvider.createServer(serverConfig);

    server.queue.drain = function() {
      done();
    };

    request(server)
      .post('/update')
      .send({
        access_token: '<PASSWORD>'
      })
      .expect(202)
      .end(function(err) {
        if(err) {
          throw err;
        }
      });
  });
});
{'fraction_non_alphanumeric': 0.14495873699318262, 'fraction_numerical': 0.012917115177610334, 'mean_word_length': 3.2629969418960245, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, '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': '4352039', 'n_tokens_mistral': 872, 'n_tokens_neox': 828, 'n_words': 163}