Merge pull request #1297 from geekerzp/objc_upload_file

[Objc] Add test case in objc client
This commit is contained in:
wing328 2015-09-29 14:49:37 +08:00
commit a2f47672e7

View File

@ -218,8 +218,8 @@
[self waitForExpectationsWithTimeout:10.0 handler:nil];
}
- (void)testUploadFile {
XCTestExpectation *expectation = [self expectationWithDescription:@"testUploadWithFile"];
- (void)testUploadFileWithFormParameter {
XCTestExpectation *expectation = [self expectationWithDescription:@"testUploadWithFileWithFormParameter"];
NSURL *fileURL = [self createTempFile];
@ -236,6 +236,23 @@
[self waitForExpectationsWithTimeout:10.0 handler:nil];
}
- (void)testUploadFile {
XCTestExpectation *expectation = [self expectationWithDescription:@"testUploadFile"];
NSURL *fileURL = [self createTempFile];
[api uploadFileWithCompletionBlock:@1 additionalMetadata:nil file:fileURL completionHandler:^(NSError *error) {
if (error) {
XCTFail(@"expected a failure");
}
else {
[expectation fulfill];
}
}];
[self waitForExpectationsWithTimeout:10.0 handler:nil];
}
- (void)TestUploadWithoutFile {
XCTestExpectation *expectation = [self expectationWithDescription:@"testUploadWithoutFile"];