Skip to content

Commit b97030b

Browse files
tystar86claude
andcommitted
Pass the init arguments as a tuple
argparse accepts any sequence, so the arguments from click are passed on without converting them to a list. The test keeps the arguments in one variable that is both passed and checked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 28765ef commit b97030b

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

‎src/render_engine_cli/cli.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def init(args: tuple[str, ...]) -> None:
7373
"""Create a new Render Engine site."""
7474
from render_engine.init.__main__ import main
7575

76-
main(list(args), prog="render-engine init")
76+
main(args, prog="render-engine init")
7777

7878

7979
@app.command

‎tests/test_render_engine_init.py‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,11 @@ def test_init_is_listed_in_the_help(runner):
2323
def test_init_passes_the_arguments_to_render_engine(runner, mocker):
2424
"""All arguments after `init` are passed to render-engine's init, with the CLI's command name."""
2525
main = mocker.patch("render_engine.init.__main__.main")
26+
args = ("--no-input", "-o", "sites", "-e", '{"site_title": "My Blog"}')
2627

27-
runner.invoke(app, ["init", "--no-input", "-o", "sites", "-e", '{"site_title": "My Blog"}'])
28+
runner.invoke(app, ["init", *args])
2829

29-
main.assert_called_once_with(
30-
["--no-input", "-o", "sites", "-e", '{"site_title": "My Blog"}'], prog="render-engine init"
31-
)
30+
main.assert_called_once_with(args, prog="render-engine init")
3231

3332

3433
def test_init_help_shows_the_init_options(runner):

0 commit comments

Comments
 (0)