Skip to content

Commit edf009a

Browse files
updated tests
1 parent c6a93b6 commit edf009a

File tree

5 files changed

+12
-12
lines changed
  • end_to_end_tests
    • golden-record/my_test_api_client
    • literal-enums-golden-record/my_enum_api_client
    • test-3-1-golden-record/test_3_1_features_client
  • integration-tests/integration_tests
  • openapi_python_client/templates

5 files changed

+12
-12
lines changed

end_to_end_tests/golden-record/my_test_api_client/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import ssl
2+
import urllib.parse
23
from typing import Any, Optional, Union
34

45
import httpx
56
from attrs import define, evolve, field
6-
import urllib.parse
77

88

99
@define
@@ -274,7 +274,7 @@ def replace_client_path(client: Client, base_path: str) -> Client:
274274
parsed = urllib.parse.urlparse(client.base_url)
275275
# _replace is not private, it's part of the NamedTuple API but prefixed _ to avoid conflicts
276276
updated_url = parsed._replace(path=base_path)
277-
client.base_url = updated_url.geturl()
277+
client._base_url = updated_url.geturl()
278278
return client
279279

280280

end_to_end_tests/literal-enums-golden-record/my_enum_api_client/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import ssl
2+
import urllib.parse
23
from typing import Any, Optional, Union
34

45
import httpx
56
from attrs import define, evolve, field
6-
import urllib.parse
77

88

99
@define
@@ -274,7 +274,7 @@ def replace_client_path(client: Client, base_path: str) -> Client:
274274
parsed = urllib.parse.urlparse(client.base_url)
275275
# _replace is not private, it's part of the NamedTuple API but prefixed _ to avoid conflicts
276276
updated_url = parsed._replace(path=base_path)
277-
client.base_url = updated_url.geturl()
277+
client._base_url = updated_url.geturl()
278278
return client
279279

280280

end_to_end_tests/test-3-1-golden-record/test_3_1_features_client/client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import ssl
2+
import urllib.parse
23
from typing import Any, Optional, Union
34

45
import httpx
56
from attrs import define, evolve, field
6-
import urllib.parse
77

88

99
@define
@@ -274,8 +274,8 @@ def replace_client_path(client: Client, base_path: str) -> Client:
274274
parsed = urllib.parse.urlparse(client.base_url)
275275
# _replace is not private, it's part of the NamedTuple API but prefixed _ to avoid conflicts
276276
updated_url = parsed._replace(path=base_path)
277-
client.base_url = updated_url.geturl()
278-
return client.with_base_url(updated_url.geturl())
277+
client._base_url = updated_url.geturl()
278+
return client
279279

280280

281281
def v3_stable_client(client: Client) -> Client:

integration-tests/integration_tests/client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,8 @@ def replace_client_path(client: Client, base_path: str) -> Client:
274274
parsed = urllib.parse.urlparse(client.base_url)
275275
# _replace is not private, it's part of the NamedTuple API but prefixed _ to avoid conflicts
276276
updated_url = parsed._replace(path=base_path)
277-
return client.with_base_url(updated_url.geturl())
277+
client._base_url = updated_url.geturl()
278+
return client
278279

279280

280281
def v3_stable_client(client: Client) -> Client:

openapi_python_client/templates/client.py.jinja

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import ssl
2+
import urllib.parse
23
from typing import Any, Union, Optional
34

45
from attrs import define, field, evolve
56
import httpx
6-
import urllib.parse
77

88

99
{% set attrs_info = {
@@ -196,9 +196,8 @@ def replace_client_path(client: Client, base_path: str) -> Client:
196196
parsed = urllib.parse.urlparse(client.base_url)
197197
# _replace is not private, it's part of the NamedTuple API but prefixed _ to avoid conflicts
198198
updated_url = parsed._replace(path=base_path)
199-
client.base_url = updated_url.geturl()
200-
return client.with_base_url(updated_url.geturl())
201-
199+
client._base_url = updated_url.geturl()
200+
return client
202201

203202
def v3_stable_client(client: Client) -> Client:
204203
"""Override a client's base URL with a v2 stable path."""

0 commit comments

Comments
 (0)