/**
* GPII PackageKit Device Reporter Tests
*
* Copyright 2014 Emergya
*
* Licensed under the New BSD license. You may not use this file except in
* compliance with this License.
*
* You may obtain a copy of the License at
* https://github.com/GPII/linux/blob/master/LICENSE.txt
*
* The research leading to these results has received funding from the European Union's
* Seventh Framework Programme (FP7/2007-2013)
* under grant agreement no. 289016.
*/
"use strict";
var fluid = require("universal"),
jqUnit = fluid.require("node-jqunit");
require("packagekit");
var gpii = fluid.registerNamespace("gpii");
var packageKit = fluid.registerNamespace("gpii.packageKit");
jqUnit.module("GPII PackageKit Module");
jqUnit.test("Running tests for PackageKit Device Reporter", function () {
jqUnit.expect(4);
// Check that the bridge is loaded and required methods are available
//
var methods = ["get", "find"];
for (var method in methods) {
jqUnit.assertTrue("Checking availability of method '" + method + "'",
(methods[method] in packageKit));
}
jqUnit.assertDeepEq("Checking that 'get' reports both 'id' and 'data'",
["id", "data"],
Object.keys(gpii.packageKit.get("installed")));
jqUnit.assertTrue("Checking that 'get' report installed packages",
(gpii.packageKit.get("installed").data.length > 0));
});
|