mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-07 19:08:52 +00:00
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];
|
||||
}
|
||||
|
||||
- (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"];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user