Skip to content

Commit c8ae42d

Browse files
committed
Fix custom template E2E test
1 parent 9bc20ed commit c8ae42d

32 files changed

+16
-15
lines changed

end_to_end_tests/golden-record-custom/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
1-
# my-test-api-client
1+
# custom-e2e
22
A client library for accessing My Test API
33

44
## Usage
55
First, create a client:
66

77
```python
8-
from my_test_api_client import Client
8+
from custom_e2e import Client
99

1010
client = Client(base_url="https://api.example.com")
1111
```
1212

1313
If the endpoints you're going to hit require authentication, use `AuthenticatedClient` instead:
1414

1515
```python
16-
from my_test_api_client import AuthenticatedClient
16+
from custom_e2e import AuthenticatedClient
1717

1818
client = AuthenticatedClient(base_url="https://api.example.com", token="SuperSecretToken")
1919
```
2020

2121
Now call your endpoint and use your models:
2222

2323
```python
24-
from my_test_api_client.models import MyDataModel
25-
from my_test_api_client.api.my_tag import get_my_data_model
24+
from custom_e2e.models import MyDataModel
25+
from custom_e2e.api.my_tag import get_my_data_model
2626

2727
my_data: MyDataModel = get_my_data_model(client=client)
2828
```
2929

3030
Or do the same thing with an async version:
3131

3232
```python
33-
from my_test_api_client.models import MyDataModel
34-
from my_test_api_client.async_api.my_tag import get_my_data_model
33+
from custom_e2e.models import MyDataModel
34+
from custom_e2e.async_api.my_tag import get_my_data_model
3535

3636
my_data: MyDataModel = await get_my_data_model(client=client)
3737
```
@@ -40,9 +40,9 @@ Things to know:
4040
1. Every path/method combo becomes a Python function with type annotations.
4141
1. All path/query params, and bodies become method arguments.
4242
1. If your endpoint had any tags on it, the first tag will be used as a module name for the function (my_tag above)
43-
1. Any endpoint which did not have a tag will be in `my_test_api_client.api.default`
43+
1. Any endpoint which did not have a tag will be in `custom_e2e.api.default`
4444
1. If the API returns a response code that was not declared in the OpenAPI document, a
45-
`my_test_api_client.api.errors.ApiResponseError` wil be raised
45+
`custom_e2e.api.errors.ApiResponseError` wil be raised
4646
with the `response` attribute set to the `httpx.Response` that was received.
4747

4848

end_to_end_tests/golden-record-custom/pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
[tool.poetry]
2-
name = "my-test-api-client"
2+
name = "custom-e2e"
33
version = "0.1.0"
44
description = "A client library for accessing My Test API"
55

66
authors = []
77

88
readme = "README.md"
99
packages = [
10-
{include = "my_test_api_client"},
10+
{include = "custom_e2e"},
1111
]
12-
include = ["CHANGELOG.md", "my_test_api_client/py.typed"]
12+
include = ["CHANGELOG.md", "custom_e2e/py.typed"]
1313

1414

1515
[tool.poetry.dependencies]

end_to_end_tests/regen_golden_record.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,18 @@
1111
runner = CliRunner()
1212
openapi_path = Path(__file__).parent / "openapi.json"
1313

14-
output_path = Path.cwd() / "my-test-api-client"
15-
1614
custom = len(sys.argv) >= 2 and sys.argv[1] == "custom"
1715
if custom:
1816
gr_path = Path(__file__).parent / "golden-record-custom"
17+
output_path = Path.cwd() / "custom-e2e"
18+
config_path = Path(__file__).parent / "custom_config.yml"
1919
else:
2020
gr_path = Path(__file__).parent / "golden-record"
21+
output_path = Path.cwd() / "my-test-api-client"
22+
config_path = Path(__file__).parent / "config.yml"
2123

2224
shutil.rmtree(gr_path, ignore_errors=True)
2325
shutil.rmtree(output_path, ignore_errors=True)
24-
config_path = Path(__file__).parent / "config.yml"
2526

2627
if custom:
2728
result = runner.invoke(

0 commit comments

Comments
 (0)