<commit_before>should = require('chai').Should()
async = require('async')
Client = require('request-json').JsonClient
app = require('../server')
fakeServer = require('./helpers').fakeServer

client = new Client 'http://localhost:8888/'

describe 'Connectors - Bank', ->
    
    # Start application before starting tests.
    before (done) ->
        app.listen 8888
        done()

    before ->
        data = [
            { label: 'compte courant', balance: '1000' }
            { label: 'livret A', balance: '2000' }
        ]
        indexer = fakeServer data, 200, (url, body) ->
            if url is '/connectors/bank/bnp/'
                should.exist body.fields
                should.exist body.login
                should.exist body.password

        indexer.listen 9102

    describe 'Bank account data retrieval', ->


        it 'When I send a request for my bank account data', (done) ->
            data =
                login: 'me'
                password: '<PASSWORD>'
            client.post 'connectors/bank/bnp', data, (err, res, body) =>
                @res = res
                @body = body
                done()

        it 'Then I got my account balances', ->
            @res.statusCode.should.equal 200
            @body.length.should.equal 2
            @body[0].label.should.equal 'compte courant'
            @body[0].balance.should.equal '1000'
            @body[1].label.should.equal 'livret A'
            @body[1].balance.should.equal '2000'<commit_msg>clean connector tests<commit_after>should = require('chai').Should()
async = require('async')
Client = require('request-json').JsonClient
app = require('../server')
fakeServer = require('./helpers').fakeServer

client = new Client 'http://localhost:8888/'

describe 'Connectors - Bank', ->
    
    # Start application before starting tests.
    before (done) ->
        app.listen 8888
        done()

    before ->
        data = [
            { label: 'compte courant', balance: '1000' }
            { label: 'livret A', balance: '2000' }
        ]
        indexer = fakeServer data, 200, (url, body) ->
            
            if url is '/connectors/bank/bnp/'
                should.exist body.login
                should.exist body.password

        indexer.listen 9102

    describe 'Bank account data retrieval', ->


        it 'When I send a request for my bank account data', (done) ->
            data =
                login: 'me'
                password: '<PASSWORD>'
            client.post 'connectors/bank/bnp/', data, (err, res, body) =>
                @res = res
                @body = body
                done()

        it 'Then I got my account balances', ->
            @res.statusCode.should.equal 200
            @body.length.should.equal 2
            @body[0].label.should.equal 'compte courant'
            @body[0].balance.should.equal '1000'
            @body[1].label.should.equal 'livret A'
            @body[1].balance.should.equal '2000'
{'fraction_non_alphanumeric': 0.12815338042381433, 'fraction_numerical': 0.026236125126135216, 'mean_word_length': 1.7410138248847926, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 21, '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': '6019665', 'n_tokens_mistral': 890, 'n_tokens_neox': 803, 'n_words': 221}