Skip to content

Commit

Permalink
Log : resumeupload 添加crc64 返回数值
Browse files Browse the repository at this point in the history
  • Loading branch information
1019272778 committed Mar 15, 2019
1 parent 0e63944 commit 31b64f7
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions OSSSwiftDemo/OSSSwiftDemoTests/OSSCheckCRC64Tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,27 @@ class OSSCheckCRC64Tests: OSSSwiftDemoTests {
XCTAssertNil(task.error)
}

func testAPI_resumableUpload() {

var result: OSSResumableUploadResult? = nil

let fileURL = Bundle.main.url(forResource: "wangwang", withExtension: "zip")
let request = OSSResumableUploadRequest()
request.uploadingFileURL = fileURL!
request.partSize = 307200
request.bucketName = OSS_BUCKET_PUBLIC
request.objectKey = OSS_RESUMABLE_UPLOADKEY
request.uploadProgress = {(bytesSent, totalByteSent, totalBytesExpectedToSend) ->Void in
print("bytesSent: \(bytesSent),totalByteSent: \(totalByteSent),totalBytesExpectedToSend: \(totalBytesExpectedToSend)")
}

let task = client.resumableUpload(request)
task.continue({ (t) -> Any? in
result = t.result as? OSSResumableUploadResult
print("===remoteCRC64ecma=== \(result?.httpResponseHeaderFields["x-oss-hash-crc64ecma"])")
XCTAssertNil(t.error)
return nil
}).waitUntilFinished()
}

}

0 comments on commit 31b64f7

Please sign in to comment.