<commit_before>should  = require('should')
async    = require('async')
_        = require('underscore')
Proxy    = require('./proxy')

uuid = require('node-uuid').v4

AMQP = require('src/amqp')

describe 'Rabbit Plugin', () ->
  it 'tests we can connect with a master node for a non-existant queue', (done) ->
    this.timeout(5000)
    amqp = null
    queue = uuid()

    async.series [
      (next)->

        amqp = new AMQP  {host:['127.0.0.1', 'localhost'], rabbitMasterNode:{queue}}, (e, r)->
          should.not.exist e
          next()

      (next)->
        amqp.queue {queue}, (e,q)->
          q.declare ()->
            q.bind "amq.direct", queue, next

      (next)->
        messageProcessor = ()->

        amqp.consume queue, {}, messageProcessor, (e,r)->
          should.not.exist e
          next()
    ], done

  it 'tests we can try to connect to a with a masterNode with no api server', (done) ->
    amqp = null
    queue = uuid()

    async.series [
      (next)->
<commit_msg>Fix typo existant<commit_after>should  = require('should')
async    = require('async')
_        = require('underscore')
Proxy    = require('./proxy')

uuid = require('node-uuid').v4

AMQP = require('src/amqp')

describe 'Rabbit Plugin', () ->
  it 'tests we can connect with a master node for a non-existent queue', (done) ->
    this.timeout(5000)
    amqp = null
    queue = uuid()

    async.series [
      (next)->

        amqp = new AMQP  {host:['127.0.0.1', 'localhost'], rabbitMasterNode:{queue}}, (e, r)->
          should.not.exist e
          next()

      (next)->
        amqp.queue {queue}, (e,q)->
          q.declare ()->
            q.bind "amq.direct", queue, next

      (next)->
        messageProcessor = ()->

        amqp.consume queue, {}, messageProcessor, (e,r)->
          should.not.exist e
          next()
    ], done

  it 'tests we can try to connect to a with a masterNode with no api server', (done) ->
    amqp = null
    queue = uuid()

    async.series [
      (next)->

{'fraction_non_alphanumeric': 0.16019900497512438, 'fraction_numerical': 0.010945273631840797, 'mean_word_length': 2.098613251155624, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '4085805', 'n_tokens_mistral': 667, 'n_tokens_neox': 629, 'n_words': 178}