<commit_before>/*global describe, it, chai, expect */

"use strict";
var assert = require("assert"),
    chai = require("chai"),
    expect = chai.expect,
    chaiHttp = require('chai-http'),
    http = require('http'),
    cheerio = require('cheerio');

chai.use(chaiHttp);

var parameters = {hostname: '192.168.50.50', port: '7000', path: '/'};

describe('PatronClient', function () {
    describe('/', function () {
        it('should return status OK', function (done) {
            chai.request('http://' + parameters.hostname + ':' + parameters.port).
                get(parameters.path).
                end(function (err, res) {
                    expect(err).to.equal(null);
                    expect(res).to.have.status(200);
                    done();
                });
        });
    });
    describe('/', function () {
        it('should find text "Sult av Knut Hamsun"', function (done) {
            http.get(parameters, function (res) {
                var body = '',
                    $ = '';
                res.on('data', function (chunk) {
                    body += chunk;
                });
                res.on('end', function () {
                    $ = cheerio.load(body);
                    expect($('h1').text()).to.equal("Sult av Knut Hamsun");
                    done();
                });
            }).on('error', function (e) {
                console.log("Got error: ", e);
            });
        });
    });
});<commit_msg>Fix test text to match real case<commit_after>/*global describe, it, chai, expect */

"use strict";
var assert = require("assert"),
    chai = require("chai"),
    expect = chai.expect,
    chaiHttp = require('chai-http'),
    http = require('http'),
    cheerio = require('cheerio');

chai.use(chaiHttp);

var parameters = {hostname: '192.168.50.50', port: '7000', path: '/'};

describe('PatronClient', function () {
    describe('/', function () {
        it('should return status OK', function (done) {
            chai.request('http://' + parameters.hostname + ':' + parameters.port).
                get(parameters.path).
                end(function (err, res) {
                    expect(err).to.equal(null);
                    expect(res).to.have.status(200);
                    done();
                });
        });
    });
    describe('/', function () {
        it('should find text "Sult av <NAME> (1890)"', function (done) {
            http.get(parameters, function (res) {
                var body = '',
                    $ = '';
                res.on('data', function (chunk) {
                    body += chunk;
                });
                res.on('end', function () {
                    $ = cheerio.load(body);
                    expect($('h1').text()).to.equal("Sult av <NAME> (1890)");
                    done();
                });
            }).on('error', function (e) {
                console.log("Got error: ", e);
            });
        });
    });
});
{'fraction_non_alphanumeric': 0.1761344537815126, 'fraction_numerical': 0.014789915966386555, 'mean_word_length': 1.5327659574468084, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6258139', 'n_tokens_mistral': 869, 'n_tokens_neox': 815, 'n_words': 172}