Skip to content

Commit f3672a1

Browse files
committed
Fix typing in custom template e2e test
1 parent 4743ae8 commit f3672a1

15 files changed

+75
-45
lines changed

end_to_end_tests/golden-record-custom/custom_e2e/api/tests/defaults_tests_defaults_post.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
import httpx
44

5+
from ...types import Response
6+
57
Client = httpx.Client
68

79
import datetime
@@ -26,8 +28,8 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[None, HTTPVal
2628
return None
2729

2830

29-
def _build_response(*, response: httpx.Response) -> httpx.Response[Union[None, HTTPValidationError]]:
30-
return httpx.Response(
31+
def _build_response(*, response: httpx.Response) -> Response[Union[None, HTTPValidationError]]:
32+
return Response(
3133
status_code=response.status_code,
3234
content=response.content,
3335
headers=response.headers,
@@ -47,7 +49,7 @@ def httpx_request(
4749
list_prop: Union[Unset, List[AnEnum]] = UNSET,
4850
union_prop: Union[Unset, float, str] = "not a float",
4951
enum_prop: Union[Unset, AnEnum] = UNSET,
50-
) -> httpx.Response[Union[None, HTTPValidationError]]:
52+
) -> Response[Union[None, HTTPValidationError]]:
5153

5254
json_datetime_prop: Union[Unset, str] = UNSET
5355
if not isinstance(datetime_prop, Unset):

end_to_end_tests/golden-record-custom/custom_e2e/api/tests/get_basic_list_of_booleans.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
import httpx
44

5+
from ...types import Response
6+
57
Client = httpx.Client
68

79
from typing import List, cast
@@ -15,8 +17,8 @@ def _parse_response(*, response: httpx.Response) -> Optional[List[bool]]:
1517
return None
1618

1719

18-
def _build_response(*, response: httpx.Response) -> httpx.Response[List[bool]]:
19-
return httpx.Response(
20+
def _build_response(*, response: httpx.Response) -> Response[List[bool]]:
21+
return Response(
2022
status_code=response.status_code,
2123
content=response.content,
2224
headers=response.headers,
@@ -27,7 +29,7 @@ def _build_response(*, response: httpx.Response) -> httpx.Response[List[bool]]:
2729
def httpx_request(
2830
*,
2931
client: Client,
30-
) -> httpx.Response[List[bool]]:
32+
) -> Response[List[bool]]:
3133

3234
response = client.request(
3335
"get",

end_to_end_tests/golden-record-custom/custom_e2e/api/tests/get_basic_list_of_floats.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
import httpx
44

5+
from ...types import Response
6+
57
Client = httpx.Client
68

79
from typing import List, cast
@@ -15,8 +17,8 @@ def _parse_response(*, response: httpx.Response) -> Optional[List[float]]:
1517
return None
1618

1719

18-
def _build_response(*, response: httpx.Response) -> httpx.Response[List[float]]:
19-
return httpx.Response(
20+
def _build_response(*, response: httpx.Response) -> Response[List[float]]:
21+
return Response(
2022
status_code=response.status_code,
2123
content=response.content,
2224
headers=response.headers,
@@ -27,7 +29,7 @@ def _build_response(*, response: httpx.Response) -> httpx.Response[List[float]]:
2729
def httpx_request(
2830
*,
2931
client: Client,
30-
) -> httpx.Response[List[float]]:
32+
) -> Response[List[float]]:
3133

3234
response = client.request(
3335
"get",

end_to_end_tests/golden-record-custom/custom_e2e/api/tests/get_basic_list_of_integers.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
import httpx
44

5+
from ...types import Response
6+
57
Client = httpx.Client
68

79
from typing import List, cast
@@ -15,8 +17,8 @@ def _parse_response(*, response: httpx.Response) -> Optional[List[int]]:
1517
return None
1618

1719

18-
def _build_response(*, response: httpx.Response) -> httpx.Response[List[int]]:
19-
return httpx.Response(
20+
def _build_response(*, response: httpx.Response) -> Response[List[int]]:
21+
return Response(
2022
status_code=response.status_code,
2123
content=response.content,
2224
headers=response.headers,
@@ -27,7 +29,7 @@ def _build_response(*, response: httpx.Response) -> httpx.Response[List[int]]:
2729
def httpx_request(
2830
*,
2931
client: Client,
30-
) -> httpx.Response[List[int]]:
32+
) -> Response[List[int]]:
3133

3234
response = client.request(
3335
"get",

end_to_end_tests/golden-record-custom/custom_e2e/api/tests/get_basic_list_of_strings.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
import httpx
44

5+
from ...types import Response
6+
57
Client = httpx.Client
68

79
from typing import List, cast
@@ -15,8 +17,8 @@ def _parse_response(*, response: httpx.Response) -> Optional[List[str]]:
1517
return None
1618

1719

18-
def _build_response(*, response: httpx.Response) -> httpx.Response[List[str]]:
19-
return httpx.Response(
20+
def _build_response(*, response: httpx.Response) -> Response[List[str]]:
21+
return Response(
2022
status_code=response.status_code,
2123
content=response.content,
2224
headers=response.headers,
@@ -27,7 +29,7 @@ def _build_response(*, response: httpx.Response) -> httpx.Response[List[str]]:
2729
def httpx_request(
2830
*,
2931
client: Client,
30-
) -> httpx.Response[List[str]]:
32+
) -> Response[List[str]]:
3133

3234
response = client.request(
3335
"get",

end_to_end_tests/golden-record-custom/custom_e2e/api/tests/get_user_list.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
import httpx
44

5+
from ...types import Response
6+
57
Client = httpx.Client
68

79
import datetime
@@ -28,8 +30,8 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[List[AModel],
2830
return None
2931

3032

31-
def _build_response(*, response: httpx.Response) -> httpx.Response[Union[List[AModel], HTTPValidationError]]:
32-
return httpx.Response(
33+
def _build_response(*, response: httpx.Response) -> Response[Union[List[AModel], HTTPValidationError]]:
34+
return Response(
3335
status_code=response.status_code,
3436
content=response.content,
3537
headers=response.headers,
@@ -42,7 +44,7 @@ def httpx_request(
4244
client: Client,
4345
an_enum_value: List[AnEnum],
4446
some_date: Union[datetime.date, datetime.datetime],
45-
) -> httpx.Response[Union[List[AModel], HTTPValidationError]]:
47+
) -> Response[Union[List[AModel], HTTPValidationError]]:
4648

4749
json_an_enum_value = []
4850
for an_enum_value_item_data in an_enum_value:

end_to_end_tests/golden-record-custom/custom_e2e/api/tests/int_enum_tests_int_enum_post.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
import httpx
44

5+
from ...types import Response
6+
57
Client = httpx.Client
68

79
from typing import Dict
@@ -22,8 +24,8 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[None, HTTPVal
2224
return None
2325

2426

25-
def _build_response(*, response: httpx.Response) -> httpx.Response[Union[None, HTTPValidationError]]:
26-
return httpx.Response(
27+
def _build_response(*, response: httpx.Response) -> Response[Union[None, HTTPValidationError]]:
28+
return Response(
2729
status_code=response.status_code,
2830
content=response.content,
2931
headers=response.headers,
@@ -35,7 +37,7 @@ def httpx_request(
3537
*,
3638
client: Client,
3739
int_enum: AnIntEnum,
38-
) -> httpx.Response[Union[None, HTTPValidationError]]:
40+
) -> Response[Union[None, HTTPValidationError]]:
3941

4042
json_int_enum = int_enum.value
4143

end_to_end_tests/golden-record-custom/custom_e2e/api/tests/json_body_tests_json_body_post.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
import httpx
44

5+
from ...types import Response
6+
57
Client = httpx.Client
68

79
from ...models.a_model import AModel
@@ -20,8 +22,8 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[None, HTTPVal
2022
return None
2123

2224

23-
def _build_response(*, response: httpx.Response) -> httpx.Response[Union[None, HTTPValidationError]]:
24-
return httpx.Response(
25+
def _build_response(*, response: httpx.Response) -> Response[Union[None, HTTPValidationError]]:
26+
return Response(
2527
status_code=response.status_code,
2628
content=response.content,
2729
headers=response.headers,
@@ -33,7 +35,7 @@ def httpx_request(
3335
*,
3436
client: Client,
3537
json_body: AModel,
36-
) -> httpx.Response[Union[None, HTTPValidationError]]:
38+
) -> Response[Union[None, HTTPValidationError]]:
3739

3840
json_json_body = json_body.to_dict()
3941

end_to_end_tests/golden-record-custom/custom_e2e/api/tests/no_response_tests_no_response_get.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import httpx
22

3+
from ...types import Response
4+
35
Client = httpx.Client
46

57

6-
def _build_response(*, response: httpx.Response) -> httpx.Response[None]:
7-
return httpx.Response(
8+
def _build_response(*, response: httpx.Response) -> Response[None]:
9+
return Response(
810
status_code=response.status_code,
911
content=response.content,
1012
headers=response.headers,
@@ -15,7 +17,7 @@ def _build_response(*, response: httpx.Response) -> httpx.Response[None]:
1517
def httpx_request(
1618
*,
1719
client: Client,
18-
) -> httpx.Response[None]:
20+
) -> Response[None]:
1921

2022
response = client.request(
2123
"get",

end_to_end_tests/golden-record-custom/custom_e2e/api/tests/octet_stream_tests_octet_stream_get.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
import httpx
44

5+
from ...types import Response
6+
57
Client = httpx.Client
68

79
from io import BytesIO
@@ -17,8 +19,8 @@ def _parse_response(*, response: httpx.Response) -> Optional[File]:
1719
return None
1820

1921

20-
def _build_response(*, response: httpx.Response) -> httpx.Response[File]:
21-
return httpx.Response(
22+
def _build_response(*, response: httpx.Response) -> Response[File]:
23+
return Response(
2224
status_code=response.status_code,
2325
content=response.content,
2426
headers=response.headers,
@@ -29,7 +31,7 @@ def _build_response(*, response: httpx.Response) -> httpx.Response[File]:
2931
def httpx_request(
3032
*,
3133
client: Client,
32-
) -> httpx.Response[File]:
34+
) -> Response[File]:
3335

3436
response = client.request(
3537
"get",

end_to_end_tests/golden-record-custom/custom_e2e/api/tests/optional_value_tests_optional_query_param.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
import httpx
44

5+
from ...types import Response
6+
57
Client = httpx.Client
68

79
from typing import Dict, List, Union
@@ -22,8 +24,8 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[None, HTTPVal
2224
return None
2325

2426

25-
def _build_response(*, response: httpx.Response) -> httpx.Response[Union[None, HTTPValidationError]]:
26-
return httpx.Response(
27+
def _build_response(*, response: httpx.Response) -> Response[Union[None, HTTPValidationError]]:
28+
return Response(
2729
status_code=response.status_code,
2830
content=response.content,
2931
headers=response.headers,
@@ -35,7 +37,7 @@ def httpx_request(
3537
*,
3638
client: Client,
3739
query_param: Union[Unset, List[str]] = UNSET,
38-
) -> httpx.Response[Union[None, HTTPValidationError]]:
40+
) -> Response[Union[None, HTTPValidationError]]:
3941

4042
json_query_param: Union[Unset, List[Any]] = UNSET
4143
if not isinstance(query_param, Unset):

end_to_end_tests/golden-record-custom/custom_e2e/api/tests/test_inline_objects.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
import httpx
44

5+
from ...types import Response
6+
57
Client = httpx.Client
68

79
from ...models.json_body import JsonBody
@@ -16,8 +18,8 @@ def _parse_response(*, response: httpx.Response) -> Optional[Response_200]:
1618
return None
1719

1820

19-
def _build_response(*, response: httpx.Response) -> httpx.Response[Response_200]:
20-
return httpx.Response(
21+
def _build_response(*, response: httpx.Response) -> Response[Response_200]:
22+
return Response(
2123
status_code=response.status_code,
2224
content=response.content,
2325
headers=response.headers,
@@ -29,7 +31,7 @@ def httpx_request(
2931
*,
3032
client: Client,
3133
json_body: JsonBody,
32-
) -> httpx.Response[Response_200]:
34+
) -> Response[Response_200]:
3335

3436
json_json_body = json_body.to_dict()
3537

end_to_end_tests/golden-record-custom/custom_e2e/api/tests/unsupported_content_tests_unsupported_content_get.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import httpx
22

3+
from ...types import Response
4+
35
Client = httpx.Client
46

57

6-
def _build_response(*, response: httpx.Response) -> httpx.Response[None]:
7-
return httpx.Response(
8+
def _build_response(*, response: httpx.Response) -> Response[None]:
9+
return Response(
810
status_code=response.status_code,
911
content=response.content,
1012
headers=response.headers,
@@ -15,7 +17,7 @@ def _build_response(*, response: httpx.Response) -> httpx.Response[None]:
1517
def httpx_request(
1618
*,
1719
client: Client,
18-
) -> httpx.Response[None]:
20+
) -> Response[None]:
1921

2022
response = client.request(
2123
"get",

end_to_end_tests/golden-record-custom/custom_e2e/api/tests/upload_file_tests_upload_post.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
import httpx
44

5+
from ...types import Response
6+
57
Client = httpx.Client
68

79
from typing import Dict, Union, cast
@@ -27,11 +29,11 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[
2729

2830

2931

30-
def _build_response(*, response: httpx.Response) -> httpx.Response[Union[
32+
def _build_response(*, response: httpx.Response) -> Response[Union[
3133
None,
3234
HTTPValidationError
3335
]]:
34-
return httpx.Response(
36+
return Response(
3537
status_code=response.status_code,
3638
content=response.content,
3739
headers=response.headers,
@@ -43,7 +45,7 @@ def httpx_request(*,
4345
client: Client,
4446
multipart_data: BodyUploadFileTestsUploadPost,
4547
keep_alive: Union[Unset, bool] = UNSET,
46-
) -> httpx.Response[Union[
48+
) -> Response[Union[
4749
None,
4850
HTTPValidationError
4951
]]:

0 commit comments

Comments
 (0)