Skip to content

Commit 140bcb4

Browse files
Add test case, change to check for Any instead of None
1 parent e087ff0 commit 140bcb4

16 files changed

+51
-245
lines changed

end_to_end_tests/golden-record/my_test_api_client/api/default/get_common_parameters.py

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Any, Dict, Optional, Union
1+
from typing import Any, Dict, Union
22

33
import httpx
44

@@ -30,20 +30,12 @@ def _get_kwargs(
3030
}
3131

3232

33-
def _parse_response(*, response: httpx.Response) -> Optional[Any]:
34-
if response.status_code == 200:
35-
response_200 = None
36-
37-
return response_200
38-
return None
39-
40-
4133
def _build_response(*, response: httpx.Response) -> Response[Any]:
4234
return Response(
4335
status_code=response.status_code,
4436
content=response.content,
4537
headers=response.headers,
46-
parsed=_parse_response(response=response),
38+
parsed=None,
4739
)
4840

4941

@@ -64,19 +56,6 @@ def sync_detailed(
6456
return _build_response(response=response)
6557

6658

67-
def sync(
68-
*,
69-
client: Client,
70-
common: Union[Unset, str] = UNSET,
71-
) -> Optional[Any]:
72-
""" """
73-
74-
return sync_detailed(
75-
client=client,
76-
common=common,
77-
).parsed
78-
79-
8059
async def asyncio_detailed(
8160
*,
8261
client: Client,
@@ -91,18 +70,3 @@ async def asyncio_detailed(
9170
response = await _client.get(**kwargs)
9271

9372
return _build_response(response=response)
94-
95-
96-
async def asyncio(
97-
*,
98-
client: Client,
99-
common: Union[Unset, str] = UNSET,
100-
) -> Optional[Any]:
101-
""" """
102-
103-
return (
104-
await asyncio_detailed(
105-
client=client,
106-
common=common,
107-
)
108-
).parsed

end_to_end_tests/golden-record/my_test_api_client/api/default/post_common_parameters.py

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Any, Dict, Optional, Union
1+
from typing import Any, Dict, Union
22

33
import httpx
44

@@ -30,20 +30,12 @@ def _get_kwargs(
3030
}
3131

3232

33-
def _parse_response(*, response: httpx.Response) -> Optional[Any]:
34-
if response.status_code == 200:
35-
response_200 = None
36-
37-
return response_200
38-
return None
39-
40-
4133
def _build_response(*, response: httpx.Response) -> Response[Any]:
4234
return Response(
4335
status_code=response.status_code,
4436
content=response.content,
4537
headers=response.headers,
46-
parsed=_parse_response(response=response),
38+
parsed=None,
4739
)
4840

4941

@@ -64,19 +56,6 @@ def sync_detailed(
6456
return _build_response(response=response)
6557

6658

67-
def sync(
68-
*,
69-
client: Client,
70-
common: Union[Unset, str] = UNSET,
71-
) -> Optional[Any]:
72-
""" """
73-
74-
return sync_detailed(
75-
client=client,
76-
common=common,
77-
).parsed
78-
79-
8059
async def asyncio_detailed(
8160
*,
8261
client: Client,
@@ -91,18 +70,3 @@ async def asyncio_detailed(
9170
response = await _client.post(**kwargs)
9271

9372
return _build_response(response=response)
94-
95-
96-
async def asyncio(
97-
*,
98-
client: Client,
99-
common: Union[Unset, str] = UNSET,
100-
) -> Optional[Any]:
101-
""" """
102-
103-
return (
104-
await asyncio_detailed(
105-
client=client,
106-
common=common,
107-
)
108-
).parsed

end_to_end_tests/golden-record/my_test_api_client/api/parameters/get_same_name_multiple_locations_param.py

Lines changed: 2 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Any, Dict, Optional, Union
1+
from typing import Any, Dict, Union
22

33
import httpx
44

@@ -31,20 +31,12 @@ def _get_kwargs(
3131
}
3232

3333

34-
def _parse_response(*, response: httpx.Response) -> Optional[Any]:
35-
if response.status_code == 200:
36-
response_200 = None
37-
38-
return response_200
39-
return None
40-
41-
4234
def _build_response(*, response: httpx.Response) -> Response[Any]:
4335
return Response(
4436
status_code=response.status_code,
4537
content=response.content,
4638
headers=response.headers,
47-
parsed=_parse_response(response=response),
39+
parsed=None,
4840
)
4941

5042

@@ -67,21 +59,6 @@ def sync_detailed(
6759
return _build_response(response=response)
6860

6961

70-
def sync(
71-
*,
72-
client: Client,
73-
param_path: Union[Unset, str] = UNSET,
74-
param_query: Union[Unset, str] = UNSET,
75-
) -> Optional[Any]:
76-
""" """
77-
78-
return sync_detailed(
79-
client=client,
80-
param_path=param_path,
81-
param_query=param_query,
82-
).parsed
83-
84-
8562
async def asyncio_detailed(
8663
*,
8764
client: Client,
@@ -98,20 +75,3 @@ async def asyncio_detailed(
9875
response = await _client.get(**kwargs)
9976

10077
return _build_response(response=response)
101-
102-
103-
async def asyncio(
104-
*,
105-
client: Client,
106-
param_path: Union[Unset, str] = UNSET,
107-
param_query: Union[Unset, str] = UNSET,
108-
) -> Optional[Any]:
109-
""" """
110-
111-
return (
112-
await asyncio_detailed(
113-
client=client,
114-
param_path=param_path,
115-
param_query=param_query,
116-
)
117-
).parsed

end_to_end_tests/golden-record/my_test_api_client/api/tests/defaults_tests_defaults_post.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def _get_kwargs(
133133

134134
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, HTTPValidationError]]:
135135
if response.status_code == 200:
136-
response_200 = None
136+
response_200 = response.json()
137137

138138
return response_200
139139
if response.status_code == 422:

end_to_end_tests/golden-record/my_test_api_client/api/tests/int_enum_tests_int_enum_post.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def _get_kwargs(
3636

3737
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, HTTPValidationError]]:
3838
if response.status_code == 200:
39-
response_200 = None
39+
response_200 = response.json()
4040

4141
return response_200
4242
if response.status_code == 422:

end_to_end_tests/golden-record/my_test_api_client/api/tests/json_body_tests_json_body_post.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def _get_kwargs(
3131

3232
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, HTTPValidationError]]:
3333
if response.status_code == 200:
34-
response_200 = None
34+
response_200 = response.json()
3535

3636
return response_200
3737
if response.status_code == 422:
Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Any, Dict, Optional
1+
from typing import Any, Dict
22

33
import httpx
44

@@ -23,20 +23,12 @@ def _get_kwargs(
2323
}
2424

2525

26-
def _parse_response(*, response: httpx.Response) -> Optional[Any]:
27-
if response.status_code == 200:
28-
response_200 = None
29-
30-
return response_200
31-
return None
32-
33-
3426
def _build_response(*, response: httpx.Response) -> Response[Any]:
3527
return Response(
3628
status_code=response.status_code,
3729
content=response.content,
3830
headers=response.headers,
39-
parsed=_parse_response(response=response),
31+
parsed=None,
4032
)
4133

4234

@@ -55,17 +47,6 @@ def sync_detailed(
5547
return _build_response(response=response)
5648

5749

58-
def sync(
59-
*,
60-
client: Client,
61-
) -> Optional[Any]:
62-
""" """
63-
64-
return sync_detailed(
65-
client=client,
66-
).parsed
67-
68-
6950
async def asyncio_detailed(
7051
*,
7152
client: Client,
@@ -78,16 +59,3 @@ async def asyncio_detailed(
7859
response = await _client.get(**kwargs)
7960

8061
return _build_response(response=response)
81-
82-
83-
async def asyncio(
84-
*,
85-
client: Client,
86-
) -> Optional[Any]:
87-
""" """
88-
89-
return (
90-
await asyncio_detailed(
91-
client=client,
92-
)
93-
).parsed

end_to_end_tests/golden-record/my_test_api_client/api/tests/optional_value_tests_optional_query_param.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def _get_kwargs(
3737

3838
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, HTTPValidationError]]:
3939
if response.status_code == 200:
40-
response_200 = None
40+
response_200 = response.json()
4141

4242
return response_200
4343
if response.status_code == 422:
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Any, Dict, Optional
1+
from typing import Any, Dict
22

33
import httpx
44

@@ -26,24 +26,12 @@ def _get_kwargs(
2626
}
2727

2828

29-
def _parse_response(*, response: httpx.Response) -> Optional[Any]:
30-
if response.status_code == 200:
31-
response_200 = None
32-
33-
return response_200
34-
if response.status_code == 401:
35-
response_401 = None
36-
37-
return response_401
38-
return None
39-
40-
4129
def _build_response(*, response: httpx.Response) -> Response[Any]:
4230
return Response(
4331
status_code=response.status_code,
4432
content=response.content,
4533
headers=response.headers,
46-
parsed=_parse_response(response=response),
34+
parsed=None,
4735
)
4836

4937

@@ -64,19 +52,6 @@ def sync_detailed(
6452
return _build_response(response=response)
6553

6654

67-
def sync(
68-
*,
69-
client: Client,
70-
my_token: str,
71-
) -> Optional[Any]:
72-
"""Test optional cookie parameters"""
73-
74-
return sync_detailed(
75-
client=client,
76-
my_token=my_token,
77-
).parsed
78-
79-
8055
async def asyncio_detailed(
8156
*,
8257
client: Client,
@@ -91,18 +66,3 @@ async def asyncio_detailed(
9166
response = await _client.get(**kwargs)
9267

9368
return _build_response(response=response)
94-
95-
96-
async def asyncio(
97-
*,
98-
client: Client,
99-
my_token: str,
100-
) -> Optional[Any]:
101-
"""Test optional cookie parameters"""
102-
103-
return (
104-
await asyncio_detailed(
105-
client=client,
106-
my_token=my_token,
107-
)
108-
).parsed

0 commit comments

Comments
 (0)