forked from loafle/openapi-generator-original
Add test case in objc client
This commit is contained in:
parent
5e805c2be6
commit
6bdfb8810c
@ -2,6 +2,11 @@
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>NSAppTransportSecurity</key>
|
||||
<dict>
|
||||
<key>NSAllowsArbitraryLoads</key>
|
||||
<true/>
|
||||
</dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
|
@ -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…
x
Reference in New Issue
Block a user