Skip to content

Commit

Permalink
object put retention unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
dvasilas committed Dec 18, 2024
1 parent 72d70ac commit 9fa239e
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions tests/unit/api/objectPutRetention.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const assert = require('assert');
const moment = require('moment');
const sinon = require('sinon');

const { errors } = require('arsenal');
const { bucketPut } = require('../../../lib/api/bucketPut');
Expand Down Expand Up @@ -223,5 +224,34 @@ describe('putObjectRetention API', () => {
});
});
});

describe('overheadField', () => {
before(done => {
cleanup();
sinon.spy(metadata, 'putObjectMD');
return done();
});

after(() => {
metadata.putObjectMD.restore();
cleanup();
});

it('should pass overheadField', done => {
objectPutRetention(authInfo, putObjRetRequestGovernance, log, err => {
assert.ifError(err);
sinon.assert.calledWith(
metadata.putObjectMD,
sinon.match.string, // MPU shadow bucket
objectName,
sinon.match.any,
sinon.match({ overheadField: sinon.match.array }),
sinon.match.any,
sinon.match.any
);
done();
});
});
});
});
});

0 comments on commit 9fa239e

Please sign in to comment.