updated storage tests
This commit is contained in:
parent
67f586b65c
commit
a11b4b677c
|
@ -112,11 +112,10 @@ describe('Testing Set using aws', function() {
|
||||||
sinon.stub(crypto, 'randomBytes').returns(buf);
|
sinon.stub(crypto, 'randomBytes').returns(buf);
|
||||||
s3Stub.upload.callsArgWith(1, null, {});
|
s3Stub.upload.callsArgWith(1, null, {});
|
||||||
return storage
|
return storage
|
||||||
.set('123', {}, 'Filename.moz', 'url.com')
|
.set('123', {}, 'Filename.moz', {})
|
||||||
.then(reply => {
|
.then(deleteKey => {
|
||||||
assert.equal(reply.uuid, buf.toString('hex'));
|
assert.equal(deleteKey, buf.toString('hex'));
|
||||||
assert.equal(reply.url, 'url.com');
|
assert.notEqual(deleteKey, null);
|
||||||
assert.notEqual(reply.uuid, null);
|
|
||||||
assert(expire.calledOnce);
|
assert(expire.calledOnce);
|
||||||
assert(expire.calledWith('123', 86400000));
|
assert(expire.calledWith('123', 86400000));
|
||||||
})
|
})
|
||||||
|
|
|
@ -122,10 +122,9 @@ describe('Testing Set to local filesystem', function() {
|
||||||
fsStub.createWriteStream.returns({ on: stub });
|
fsStub.createWriteStream.returns({ on: stub });
|
||||||
|
|
||||||
return storage
|
return storage
|
||||||
.set('test', { pipe: sinon.stub() }, 'Filename.moz', 'moz.la')
|
.set('test', { pipe: sinon.stub() }, 'Filename.moz', {})
|
||||||
.then(reply => {
|
.then(deleteKey => {
|
||||||
assert(reply.uuid);
|
assert(deleteKey);
|
||||||
assert.equal(reply.url, 'moz.la');
|
|
||||||
})
|
})
|
||||||
.catch(err => assert.fail());
|
.catch(err => assert.fail());
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue