Skip to content

Commit

Permalink
Add test case for accessTierInferred (#375)
Browse files Browse the repository at this point in the history
  • Loading branch information
blueww authored and XiaoningLiu committed Dec 26, 2019
1 parent 53d61fa commit 1c5e332
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion tests/blob/apis/blob.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -426,14 +426,38 @@ describe("BlobAPIs", () => {
});

it("setTier set default to cool @loki @sql", async () => {
// Created Blob should have accessTierInferred as true in Get/list
let properties = await blockBlobURL.getProperties(Aborter.none);
assert.equal(properties.accessTier!.toLowerCase(), "hot");
assert.equal(true, properties.accessTierInferred);

let listResult = containerURL.listBlobFlatSegment(Aborter.none, undefined, {
prefix: blobName
});
assert.equal(
true,
(await listResult).segment.blobItems[0].properties.accessTierInferred
);

const result = await blockBlobURL.setTier(Aborter.none, "Cool");
assert.equal(
result._response.request.headers.get("x-ms-client-request-id"),
result.clientRequestId
);

const properties = await blockBlobURL.getProperties(Aborter.none);
// After setTier, Blob should have accessTierInferred as false in Get
properties = await blockBlobURL.getProperties(Aborter.none);
assert.equal(properties.accessTier!.toLowerCase(), "cool");
assert.equal(false, properties.accessTierInferred);

// After setTier, Blob should have accessTierInferred as undefined in list
listResult = containerURL.listBlobFlatSegment(Aborter.none, undefined, {
prefix: blobName
});
assert.equal(
undefined,
(await listResult).segment.blobItems[0].properties.accessTierInferred
);
});

it("setTier set archive to hot @loki @sql", async () => {
Expand Down

0 comments on commit 1c5e332

Please sign in to comment.