<commit_before>var assert = require('assert');

var vumigo = require('../../lib');
var test_utils = vumigo.test_utils;

var api = vumigo.http.api;
var HttpApi = api.HttpApi;
var JsonApi = api.JsonApi;
var UrlParams = api.UrlParams;
var HttpRequest = api.HttpRequest;
var HttpResponse = api.HttpResponse;
var HttpResponseError = api.HttpResponseError;
var HttpRequestError = api.HttpRequestError;


describe("htto.api", function() {
    describe("HttpRequestError", function() {
        var request;

        beforeEach(function() {
            request = new HttpRequest('GET', 'http://foo.com/');
        });

        describe(".message", function() {
            it("should include the request", function() {
                var error = new HttpRequestError(request);
                assert(error.message.indexOf(request) > -1);
            });

            it("should include the error reason if available", function() {
                var error = new HttpRequestError(request, 'Sigh');
                assert(error.message.indexOf('Sigh') > -1);
            });
        });
    });

    describe("HttpResponseError", function() {
        var response;

        beforeEach(function() {
            var request = new HttpRequest('GET', 'http://foo.com/');
            response = new HttpResponse(request, 404);
        });

        describe(".message", function() {
            it("should include the response", function() {<commit_msg>Fix test description typo: htto.api -> http.api<commit_after>var assert = require('assert');

var vumigo = require('../../lib');
var test_utils = vumigo.test_utils;

var api = vumigo.http.api;
var HttpApi = api.HttpApi;
var JsonApi = api.JsonApi;
var UrlParams = api.UrlParams;
var HttpRequest = api.HttpRequest;
var HttpResponse = api.HttpResponse;
var HttpResponseError = api.HttpResponseError;
var HttpRequestError = api.HttpRequestError;


describe("http.api", function() {
    describe("HttpRequestError", function() {
        var request;

        beforeEach(function() {
            request = new HttpRequest('GET', 'http://foo.com/');
        });

        describe(".message", function() {
            it("should include the request", function() {
                var error = new HttpRequestError(request);
                assert(error.message.indexOf(request) > -1);
            });

            it("should include the error reason if available", function() {
                var error = new HttpRequestError(request, 'Sigh');
                assert(error.message.indexOf('Sigh') > -1);
            });
        });
    });

    describe("HttpResponseError", function() {
        var response;

        beforeEach(function() {
            var request = new HttpRequest('GET', 'http://foo.com/');
            response = new HttpResponse(request, 404);
        });

        describe(".message", function() {
            it("should include the response", function() {
{'fraction_non_alphanumeric': 0.13917525773195877, 'fraction_numerical': 0.003436426116838488, 'mean_word_length': 2.4820574162679425, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, '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': '5688407', 'n_tokens_mistral': 791, 'n_tokens_neox': 761, 'n_words': 191}