Skip to content

Commit 783002e

Browse files
committed
restore some missing test coverage
1 parent 53fca35 commit 783002e

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

end_to_end_tests/end_to_end_test_helpers.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,18 +78,17 @@ def generate_client(
7878
extra_args: List[str] = [],
7979
output_path: str = "my-test-api-client",
8080
base_module: str = "my_test_api_client",
81+
specify_output_path_explicitly: bool = True,
8182
overwrite: bool = True,
8283
raise_on_error: bool = True,
8384
) -> GeneratedClientContext:
8485
"""Run the generator and return a GeneratedClientContext for accessing the generated code."""
8586
full_output_path = Path.cwd() / output_path
8687
if not overwrite:
8788
shutil.rmtree(full_output_path, ignore_errors=True)
88-
args = [
89-
*extra_args,
90-
"--output-path",
91-
str(full_output_path),
92-
]
89+
args = extra_args
90+
if specify_output_path_explicitly:
91+
args = [*args, "--output-path", str(full_output_path)]
9392
if overwrite:
9493
args = [*args, "--overwrite"]
9594
generator_result = _run_command("generate", args, openapi_document, raise_on_error=raise_on_error)

end_to_end_tests/test_end_to_end.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,9 @@ def run_e2e_test(
8686
golden_record_path: str = "golden-record",
8787
output_path: str = "my-test-api-client",
8888
expected_missing: Optional[Set[str]] = None,
89+
specify_output_path_explicitly: bool = True,
8990
) -> Result:
90-
with generate_client(openapi_document, extra_args, output_path) as g:
91+
with generate_client(openapi_document, extra_args, output_path, specify_output_path_explicitly=specify_output_path_explicitly) as g:
9192
gr_path = Path(__file__).parent / golden_record_path
9293

9394
expected_differences = expected_differences or {}
@@ -165,6 +166,7 @@ def test_none_meta():
165166
golden_record_path="test-3-1-golden-record/test_3_1_features_client",
166167
output_path="test_3_1_features_client",
167168
expected_missing={"py.typed"},
169+
specify_output_path_explicitly=False,
168170
)
169171

170172

0 commit comments

Comments
 (0)