Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('getting container properties should fail with multiple buckets error', function () {
sandbox.restore();
sandbox.stub(AliStorage.prototype, 'useBucket').withArgs(settings.container).returns(listFilesStub);
sandbox.stub(AliStorage.prototype, 'listBuckets').withArgs({ prefix: settings.container }).callsFake(incorrectBucketStub2);
return client.getContainer()
.then(() => {
logger.error('The get container call should fails');
throw new Error('The get container call should fails');
})
.catch(err => {
expect(err.message).to.equal(`More than 1 Buckets with prefix ${settings.container} exists`);
});
});
beforeEach(function () {
sandbox = sinon.createSandbox();
client = new AliClient(settings);
sandbox.stub(AliStorage.prototype, 'listBuckets').withArgs({ prefix: settings.container }).callsFake(bucketStub);
sandbox.stub(AliStorage.prototype, 'useBucket').withArgs(settings.container).returns(listFilesStub);
});
afterEach(function () {