add tests to insight storage + remove used code
This commit is contained in:
parent
d511103081
commit
bd698257f9
6 changed files with 124 additions and 93 deletions
|
|
@ -118,7 +118,7 @@ InsightStorage.prototype._makeGetRequest = function(passphrase, key, callback) {
|
|||
return callback('PNOTFOUND: Profile not found');
|
||||
}
|
||||
if (response.statusCode !== 200) {
|
||||
return callback('Connection error');
|
||||
return callback('Unable to read item from insight');
|
||||
}
|
||||
return callback(null, body, InsightStorage.parseResponseHeaders(response.getAllResponseHeaders()));
|
||||
}
|
||||
|
|
@ -217,7 +217,7 @@ InsightStorage.prototype.removeItem = function(key, callback) {
|
|||
'Authorization': authHeader
|
||||
}
|
||||
};
|
||||
log.debug('erase ' + name);
|
||||
log.debug('Erasing: ' + key);
|
||||
this.request.get(getParams, function(err, response, body) {
|
||||
if (err) {
|
||||
return callback('Connection error');
|
||||
|
|
@ -236,14 +236,4 @@ InsightStorage.prototype.clear = function(callback) {
|
|||
callback();
|
||||
};
|
||||
|
||||
InsightStorage.prototype.allKeys = function(callback) {
|
||||
// TODO: compatibility with localStorage
|
||||
return callback(null);
|
||||
};
|
||||
|
||||
InsightStorage.prototype.getFirst = function(prefix, opts, callback) {
|
||||
// TODO: compatibility with localStorage
|
||||
return callback(null, true, true);
|
||||
};
|
||||
|
||||
module.exports = InsightStorage;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue