MCPcopy
hub / github.com/scality/cloudserver / checkContents

Function checkContents

tests/functional/backbeat/listLifecycleCurrents.js:40–64  ·  view source on GitHub ↗
(contents, expectedKeyVersions)

Source from the content-addressed store, hash-verified

38}
39
40function checkContents(contents, expectedKeyVersions) {
41 contents.forEach(d => {
42 assert(d.Key);
43 // The current versions listed to be lifecycle should include version id if the bucket is versioned.
44 if (expectedKeyVersions && expectedKeyVersions[d.Key]) {
45 assert(d.VersionId, expectedKeyVersions[d.Key]);
46 } else {
47 assert(!d.VersionId);
48 }
49 assert(d.LastModified);
50 assert(d.ETag && d.ETag.startsWith('"') && d.ETag.endsWith('"'));
51 assert(d.Owner.DisplayName);
52 assert(d.Owner.ID);
53 assert(d.StorageClass);
54 assert.strictEqual(d.StorageClass, 'STANDARD');
55 assert.deepStrictEqual(d.TagSet, [{
56 Key: 'mykey',
57 Value: 'myvalue',
58 }]);
59 assert.strictEqual(d.IsLatest, true);
60 assert.strictEqual(d.DataStoreName, location);
61 assert.strictEqual(d.ListType, 'current');
62 assert.strictEqual(d.Size, 3);
63 });
64}
65
66['Enabled', 'Disabled'].forEach(versioning => {
67 describe(`listLifecycleCurrents with bucket versioning ${versioning}`, () => {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected