Move node install/remove from server component to node engine

This commit is contained in:
Nick O'Leary
2015-11-08 14:06:36 +00:00
parent 1c45bc615f
commit 985875cc75
7 changed files with 291 additions and 304 deletions

View File

@@ -22,7 +22,6 @@ var sinon = require('sinon');
var when = require('when');
var redNodes = require("../../../red/nodes");
var server = require("../../../red/server");
var settings = require("../../../red/settings");
var nodes = require("../../../red/api/nodes");
@@ -213,7 +212,7 @@ describe("nodes api", function() {
name:"foo",
nodes:[{id:"123"}]
});
var installModule = sinon.stub(server,'installModule', function() {
var installModule = sinon.stub(redNodes,'installModule', function() {
return when.resolve({id:"123"});
});
@@ -242,7 +241,7 @@ describe("nodes api", function() {
var getModuleInfo = sinon.stub(redNodes,'getModuleInfo',function(id) {
return {nodes:{id:"123"}};
});
var installModule = sinon.stub(server,'installModule', function() {
var installModule = sinon.stub(redNodes,'installModule', function() {
return when.resolve({id:"123"});
});
@@ -268,7 +267,7 @@ describe("nodes api", function() {
var getModuleInfo = sinon.stub(redNodes,'getModuleInfo',function(id) {
return null;
});
var installModule = sinon.stub(server,'installModule', function() {
var installModule = sinon.stub(redNodes,'installModule', function() {
return when.reject(new Error("test error"));
});
@@ -294,7 +293,7 @@ describe("nodes api", function() {
var getModuleInfo = sinon.stub(redNodes,'getModuleInfo',function(id) {
return null;
});
var installModule = sinon.stub(server,'installModule', function() {
var installModule = sinon.stub(redNodes,'installModule', function() {
var err = new Error("test error");
err.code = 404;
return when.reject(err);
@@ -344,7 +343,7 @@ describe("nodes api", function() {
var getModuleInfo = sinon.stub(redNodes,'getModuleInfo',function(id) {
return {nodes:[{id:"123"}]};
});
var uninstallModule = sinon.stub(server,'uninstallModule', function() {
var uninstallModule = sinon.stub(redNodes,'uninstallModule', function() {
return when.resolve({id:"123"});
});
@@ -398,7 +397,7 @@ describe("nodes api", function() {
var getModuleInfo = sinon.stub(redNodes,'getModuleInfo',function(id) {
return {nodes:[{id:"123"}]};
});
var uninstallModule = sinon.stub(server,'uninstallModule', function() {
var uninstallModule = sinon.stub(redNodes,'uninstallModule', function() {
return when.reject(new Error("test error"));
});