<commit_before>
var chai = require("chai");
var R = require("ramda");
require("../mediamanager-external-library.js");
require("./mock-fns.js");

var apiTests = [];

apiTests.push({
    name: "getMostViewedVideos",
    //params: null, -- these are here for examples
    //onComplete: null -- example 
});
apiTests.push({
    name: "getLatestVideos"
});
apiTests.push({
    name: "getVideo",
    video: mockVars.video
});
apiTests.push({
    name: "searchVideos",
    term: "search-term"
});

apiTests.forEach(function (apiTest) {

    var name = apiTest.name;
    var params = apiTest.params || null;

    describe("#mediamanager.external.template." + name, function () {

        it("Should execute onComplete without error", function () {

            var expected = true;
            var result = false;
            var onComplete = apiTest.onComplete || function () {
                result = expected;
            };
            var testFn = mediamanager.external.template[ name ];
            var testFnArgs = R.merge({ 
                template: mockVars.template,
                onComplete: onComplete
            }, apiTest);<commit_msg>ADD: tests for template getVideos, getAudios, and recommendVideo<commit_after>
var chai = require("chai");
var R = require("ramda");
require("../mediamanager-external-library.js");
require("./mock-fns.js");

var apiTests = [];

apiTests.push({
    name: "getMostViewedVideos",
    //params: null, -- these are here for examples
    //onComplete: null -- example 
});
apiTests.push({
    name: "getLatestVideos"
});
apiTests.push({
    name: "getVideo",
    video: mockVars.video
});
apiTests.push({
    name: "searchVideos",
    term: "search-term"
});
apiTests.push({
    name: "getVideos"
});
apiTests.push({
    name: "getAudios"
});
apiTests.push({
    name: "recommendVideo",
    videoid: mockVars.video
});

apiTests.forEach(function (apiTest) {

    var name = apiTest.name;
    var params = apiTest.params || null;

    describe("#mediamanager.external.template." + name, function () {

        it("Should execute onComplete without error", function () {

            var expected = true;
            var result = false;
            var onComplete = apiTest.onComplete || function () {
                result = expected;
            };
            var testFn = mediamanager.external.template[ name ];
            var testFnArgs = R.merge({ 
                template: mockVars.template,
                onComplete: onComplete
            }, apiTest);
{'fraction_non_alphanumeric': 0.14103076308429885, 'fraction_numerical': 0.0, 'mean_word_length': 2.4972067039106145, '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': '5135250', 'n_tokens_mistral': 759, 'n_tokens_neox': 733, 'n_words': 175}