File tree Expand file tree Collapse file tree 3 files changed +19
-6
lines changed Expand file tree Collapse file tree 3 files changed +19
-6
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ class {{clientPrefix}}Test {
16
16
17
17
{{#blocksClient} }
18
18
{ {#tests} }
19
+ { {^isHelper} } { {! Helper tests are not supported yet} }
19
20
@Test
20
21
fun `{ {#lambda.replaceBacktick} }{ {{testName} }}{ {/lambda.replaceBacktick} }`() = runTest {
21
22
{{#autoCreateClient} }
@@ -70,6 +71,7 @@ class {{clientPrefix}}Test {
70
71
{ {/isError} }
71
72
{ {/steps} }
72
73
}
74
+ { {/isHelper} }
73
75
{ {/tests} }
74
76
{ {/blocksClient} }
75
77
}
Original file line number Diff line number Diff line change 1
- let response = try await client{ {#path} }.{ {.} }WithHTTPInfo{ {/path} }(
1
+ let response = { {#isAsync } } try await { {/isAsync } } client{ {#path} }.{ {.} }{ {#isAsync } } WithHTTPInfo{ {/isAsync } } { {/path} }(
2
2
{ {#parametersWithDataType} }{ {> tests/generateParams } }{ {^-last} },{ {/-last} }
3
3
{ {/parametersWithDataType} }{ {#requestOptions.parametersWithDataType} }{ {#-first} }, requestOptions: RequestOptions({ {/-first} }
4
4
{ {> tests/generateParams } }{ {^-last} },{ {/-last} }
5
5
){ {/requestOptions.parametersWithDataType} })
6
+ { {^isHelper} }
6
7
let responseBodyData = try XCTUnwrap(response.bodyData)
7
8
{ {#useEchoRequester} }
8
9
let echoResponse = try CodableHelper.jsonDecoder.decode(EchoResponse.self, from: responseBodyData)
9
10
{ {/useEchoRequester} }
10
11
{ {^useEchoRequester} }
11
12
let responseBodyJSON = try XCTUnwrap(responseBodyData.jsonString)
12
- let comparableData = "{ {#lambda.escapeQuotes} }{ {{match.parameters} }}{ {/lambda.escapeQuotes} }".data(using: .utf8)
13
- let comparableJSON = try XCTUnwrap(comparableData?.jsonString)
14
- { {/useEchoRequester} }
13
+ { {/useEchoRequester} }
14
+ { {/isHelper} }
Original file line number Diff line number Diff line change @@ -10,8 +10,9 @@ final class {{client}}ClientTests: XCTestCase {
10
10
11
11
let APPLICATION_ID = " my_application_id"
12
12
let API_KEY = " my_api_key"
13
- {{#blocksClient} }
13
+ {{#blocksClient} }
14
14
{ {#tests} }
15
+ { {^isHelper} } { {! Helper tests are not supported yet} }
15
16
16
17
/**
17
18
{ {testName} }
@@ -57,12 +58,22 @@ final class {{client}}ClientTests: XCTestCase {
57
58
XCTAssertEqual("{ {{match} }}", echoResponse.host);
58
59
{ {/testHost} }
59
60
{ {#testResponse} }
60
- XCTAssertEqual(comparableJSON, responseBodyJSON);
61
+ { {#matchIsObject} }
62
+ let comparableData = "{ {#lambda.escapeQuotes} }{ {{match.parameters} }}{ {/lambda.escapeQuotes} }".data(using: .utf8)
63
+ let comparableJSON = try XCTUnwrap(comparableData?.jsonString)
64
+ XCTAssertEqual(comparableJSON, responseBodyJSON);
65
+ { {/matchIsObject} }
66
+ { {^matchIsObject} }
67
+ let comparableData = "{ {#lambda.escapeQuotes} }{ {{match} }}{ {/lambda.escapeQuotes} }".data(using: .utf8)
68
+ let comparableJSON = try XCTUnwrap(comparableData?.jsonString)
69
+ XCTAssertEqual(comparableJSON, responseBodyJSON);
70
+ { {/matchIsObject} }
61
71
{ {/testResponse} }
62
72
{ {/match} }
63
73
{ {/isError} }
64
74
{ {/steps} }
65
75
}
76
+ { {/isHelper} }
66
77
{ {/tests} }
67
78
{ {/blocksClient} }
68
79
}
You can’t perform that action at this time.
0 commit comments