forked from loafle/openapi-generator-original
Merge pull request #1297 from geekerzp/objc_upload_file
[Objc] Add test case in objc client
This commit is contained in:
commit
a2f47672e7
@ -218,8 +218,8 @@
|
|||||||
[self waitForExpectationsWithTimeout:10.0 handler:nil];
|
[self waitForExpectationsWithTimeout:10.0 handler:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testUploadFile {
|
- (void)testUploadFileWithFormParameter {
|
||||||
XCTestExpectation *expectation = [self expectationWithDescription:@"testUploadWithFile"];
|
XCTestExpectation *expectation = [self expectationWithDescription:@"testUploadWithFileWithFormParameter"];
|
||||||
|
|
||||||
NSURL *fileURL = [self createTempFile];
|
NSURL *fileURL = [self createTempFile];
|
||||||
|
|
||||||
@ -236,6 +236,23 @@
|
|||||||
[self waitForExpectationsWithTimeout:10.0 handler:nil];
|
[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 {
|
- (void)TestUploadWithoutFile {
|
||||||
XCTestExpectation *expectation = [self expectationWithDescription:@"testUploadWithoutFile"];
|
XCTestExpectation *expectation = [self expectationWithDescription:@"testUploadWithoutFile"];
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user