<commit_before>/*
*
* Copyright (C) 2011, The Locker Project
* All rights reserved.
*
* Please see the LICENSE file for more information.
*
*/

var assert = require("assert");
var vows = require("vows");
var RESTeasy = require("rest-easy");
var http = require("http");
var request = require('request');
var querystring = require("querystring");
var events = require("events");
var fs = require("fs");


var tests = RESTeasy.describe("Locker core API")

tests.use("localhost", 8042)
    .discuss("Core can")
    .discuss("map existing services with")
        .path("/map")
        .get()
            .expect(200)
            .expect("has an available and installed attribute", function(err, res, body) {
                assert.isNull(err);
                var map = JSON.parse(body);
                assert.include(map, "available");
                assert.include(map, "installed");
                serviceMap = map;
            })
            .expect("has 16 available services", function(err, res, body) {
                var map = JSON.parse(body);
                assert.equal(map.available.length, 16);
            }).expect("has 7 installed services", function(err, res, body) {
                var map = JSON.parse(body);
                var count = 0;
                for (var key in map.installed) {
                    if (map.installed.hasOwnProperty(key)) ++count;
                }
                assert.equal(count, 7);
            }).expect("has the required test services installed", function(err, res, body) {
                var map = JSON.parse(body);
                assert.include(map.installed, "testURLCallback");
                // Add statements here to test for services required to test
            })
    .unpath().undiscuss()<commit_msg>updated number of installed test services<commit_after>/*
*
* Copyright (C) 2011, The Locker Project
* All rights reserved.
*
* Please see the LICENSE file for more information.
*
*/

var assert = require("assert");
var vows = require("vows");
var RESTeasy = require("rest-easy");
var http = require("http");
var request = require('request');
var querystring = require("querystring");
var events = require("events");
var fs = require("fs");


var tests = RESTeasy.describe("Locker core API")

tests.use("localhost", 8042)
    .discuss("Core can")
    .discuss("map existing services with")
        .path("/map")
        .get()
            .expect(200)
            .expect("has an available and installed attribute", function(err, res, body) {
                assert.isNull(err);
                var map = JSON.parse(body);
                assert.include(map, "available");
                assert.include(map, "installed");
                serviceMap = map;
            })
            .expect("has 16 available services", function(err, res, body) {
                var map = JSON.parse(body);
                assert.equal(map.available.length, 16);
            }).expect("has 8 installed services", function(err, res, body) {
                var map = JSON.parse(body);
                var count = 0;
                for (var key in map.installed) {
                    if (map.installed.hasOwnProperty(key)) ++count;
                }
                assert.equal(count, 8);
            }).expect("has the required test services installed", function(err, res, body) {
                var map = JSON.parse(body);
                assert.include(map.installed, "testURLCallback");
                // Add statements here to test for services required to test
            })
    .unpath().undiscuss()
{'fraction_non_alphanumeric': 0.1308253790005615, 'fraction_numerical': 0.010106681639528355, 'mean_word_length': 2.055746140651801, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5133512', 'n_tokens_mistral': 998, 'n_tokens_neox': 903, 'n_words': 278}