Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved comments for BlockBlobURL.upload() fixed #29 #50

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions blob/ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

* Improved comments for `BlockBlobURL.upload()`.
* Exported `HttpRequestBody` type for who wants to implement a customized HTTP client.

2018.12 10.3.0

* [Breaking] Updated convenience layer methods enum type parameters into typescript union types, this will help reducing bundle footprint.
Expand Down
2 changes: 1 addition & 1 deletion blob/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ main()
## More Code Samples

* [Blob Storage Examples](https://github.com/azure/azure-storage-js/tree/master/blob/samples)
* [Blob Storage Examples - Test Cases](https://github.com/azure/azure-storage-js/tree/master/blob/test/)
* [Blob Storage Examples - Test Cases](https://github.com/azure/azure-storage-js/tree/master/blob/tests/)

## License

Expand Down
6 changes: 4 additions & 2 deletions blob/lib/BlockBlobURL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,10 @@ export class BlockBlobURL extends BlobURL {
*
* @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(),
* goto documents of Aborter for more examples about request cancellation
* @param {HttpRequestBody} body
* @param {number} contentLength
* @param {HttpRequestBody} body Blob, string, ArrayBuffer, ArrayBufferView or a function
* which returns a new Readable stream whose offset is from data source beginning.
* @param {number} contentLength Length of body in bytes. Use Buffer.byteLength() to calculate body length for a
* string including non non-Base64/Hex-encoded characters.
* @param {IBlockBlobUploadOptions} [options]
* @returns {Promise<Models.BlockBlobUploadResponse>}
* @memberof BlockBlobURL
Expand Down
2 changes: 2 additions & 0 deletions blob/lib/Pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
HttpOperationResponse,
HttpPipelineLogger as IHttpPipelineLogger,
HttpPipelineLogLevel,
HttpRequestBody,
RequestPolicy,
RequestPolicyFactory,
RequestPolicyOptions,
Expand All @@ -19,6 +20,7 @@ export {
IHttpPipelineLogger,
HttpHeaders,
HttpPipelineLogLevel,
HttpRequestBody,
HttpOperationResponse,
WebResource,
BaseRequestPolicy,
Expand Down
7 changes: 4 additions & 3 deletions blob/tests/bloburl.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ describe("BlobURL", () => {
assert.equal(result.leaseState, "leased");
assert.equal(result.leaseStatus, "locked");

await sleep(16 * 1000);
await sleep(20 * 1000);

const result2 = await blobURL.getProperties(Aborter.none);
assert.ok(!result2.leaseDuration);
assert.equal(result2.leaseState, "expired");
Expand Down Expand Up @@ -187,14 +188,14 @@ describe("BlobURL", () => {
assert.equal(result.leaseState, "leased");
assert.equal(result.leaseStatus, "locked");

await blobURL.breakLease(Aborter.none, 3);
await blobURL.breakLease(Aborter.none, 5);

const result2 = await blobURL.getProperties(Aborter.none);
assert.ok(!result2.leaseDuration);
assert.equal(result2.leaseState, "breaking");
assert.equal(result2.leaseStatus, "locked");

await sleep(3 * 1000);
await sleep(5 * 1000);

const result3 = await blobURL.getProperties(Aborter.none);
assert.ok(!result3.leaseDuration);
Expand Down
3 changes: 3 additions & 0 deletions blob/tests/node/pagebloburl.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ describe("PageBlobURL", () => {
);

await containerURL.setAccessPolicy(Aborter.none, "container");

await sleep(5 * 1000);

let copySource = pageBlobURL.withSnapshot(snapshotResult.snapshot!).url;
let copyResponse = await destPageBlobURL.startCopyIncremental(
Aborter.none,
Expand Down