Skip to content

Commit d58d0fa

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

15 files changed

+60
-30
lines changed

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

+4-2
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,

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

+4-2
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,

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

+4-2
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,

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

+4-2
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,

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

+4-2
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,

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

+4-2
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,

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

+4-2
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,

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

+4-2
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,

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

+4-2
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,

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

+4-2
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,

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

+4-2
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,

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

+4-2
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,

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

+4-2
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,

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

+4-2
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,

end_to_end_tests/test_custom_templates/endpoint_module.pyi

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ from typing import Optional
22

33
import httpx
44

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

79
{% for relative in endpoint.relative_imports %}
@@ -31,8 +33,8 @@ def _parse_response(*, response: httpx.Response) -> Optional[{{ return_string }}
3133

3234

3335

34-
def _build_response(*, response: httpx.Response) -> httpx.Response[{{ return_string }}]:
35-
return httpx.Response(
36+
def _build_response(*, response: httpx.Response) -> Response[{{ return_string }}]:
37+
return Response(
3638
status_code=response.status_code,
3739
content=response.content,
3840
headers=response.headers,

0 commit comments

Comments
 (0)