Skip to content

Commit

Permalink
fix: command upload test (#139)
Browse files Browse the repository at this point in the history
  • Loading branch information
ibu1224 authored Apr 25, 2023
1 parent 3b003eb commit f44cb72
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 3 additions & 1 deletion test/helpers/aws.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,14 @@ describe('aws helper test', () => {
it('upload command as stream', () => {
const uploadParam = {
Bucket: testBucket,
Key: `caches/${cacheKey}`
Key: `command/${cacheKey}`
};
const uploadOption = {
partSize
};

awsClient.segment = 'command';

return awsClient.uploadCommandAsStream({ cacheKey, payload: Buffer.from('hellow world', 'utf8') }).then(() => {
assert.calledWith(clientMock.prototype.upload, sinon.match(uploadParam), sinon.match(uploadOption));
});
Expand Down
6 changes: 1 addition & 5 deletions test/plugins/commands.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,6 @@ describe('commands plugin test using s3', () => {
let uploadAsStreamMock;
let deleteObjMock;
let getDownloadMock;
let uploadDirectMock;
let data;

before(() => {
Expand All @@ -317,16 +316,13 @@ describe('commands plugin test using s3', () => {
uploadAsStreamMock = sinon.stub().resolves(null);
deleteObjMock = sinon.stub().resolves(null);
getDownloadMock = sinon.stub().resolves(null);
uploadDirectMock = sinon.stub().resolves(null);

awsClientMock = sinon.stub().returns({
updateLastModified: sinon.stub().yields(null),
removeObject: deleteObjMock,
getDownloadStream: getDownloadStreamMock,
uploadCmdAsStream: uploadAsStreamMock,
getDownloadObject: getDownloadMock,
uploadAsBuffer: uploadDirectMock,
uploadCommandAsStream: uploadDirectMock
uploadCommandAsStream: uploadAsStreamMock
});

data = {
Expand Down

0 comments on commit f44cb72

Please sign in to comment.