Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
21 changes: 19 additions & 2 deletions samples/client/petstore/objc/SwaggerClientTests/Tests/PetApiTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@ - (void)testDeletePet {
[self waitForExpectationsWithTimeout:10.0 handler:nil];
}

- (void)testUploadFile {
XCTestExpectation *expectation = [self expectationWithDescription:@"testUploadWithFile"];
- (void)testUploadFileWithFormParameter {
XCTestExpectation *expectation = [self expectationWithDescription:@"testUploadWithFileWithFormParameter"];

NSURL *fileURL = [self createTempFile];

Expand All @@ -236,6 +236,23 @@ - (void)testUploadFile {
[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"];

Expand Down