1
0
Fork 0

more agency request mockery

This commit is contained in:
Andreas Streichardt 2017-01-06 17:57:11 +01:00
parent 11eb78c056
commit 13e3e8e673
1 changed files with 11 additions and 1 deletions

View File

@ -29,7 +29,17 @@ exports.setup = function() {
global.ArangoAgency.set = function() { return true; };
global.ArangoAgency.write = function() { return true; };
global.ArangoAgency.increaseVersion = function() { return true; };
global.ArangoAgency.get = function() { return true; };
global.ArangoAgency.get = function(path) {
let value = {};
let pathSegments = path.split('/');
let keyValue = 1;
value.arango = pathSegments.reverse().reduce((v, key) => {
let kv = {};
kv[key] = v;
return kv;
}, keyValue);
return value;
};
global.ArangoAgency.lockRead = function() { return true; };
global.ArangoAgency.lockWrite = function() { return true; };
global.ArangoAgency.unlockRead = function() { return true; };