-
Notifications
You must be signed in to change notification settings - Fork 42
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Bug Description
The test tests/test_core_cli.py::test_cli_command_help fails on the main branch.
Test Output
def test_cli_command_help(runner):
"""Test `pdd [COMMAND] --help`."""
result = runner.invoke(cli.cli, ["generate", "--help"])
assert result.exit_code == 0
> assert "Usage: cli generate [OPTIONS] PROMPT_FILE" in result.output
E AssertionError: assert 'Usage: cli generate [OPTIONS] PROMPT_FILE' in '...Usage: cli generate [OPTIONS] [PROMPT_FILE]...'
Root Cause
The generate command's PROMPT_FILE argument was made optional (shown as [PROMPT_FILE] in help) when the --template option was added as an alternative. The test was not updated to reflect this change.
Actual CLI Help Output
Usage: cli generate [OPTIONS] [PROMPT_FILE]
Create runnable code from a prompt file.
Options:
--template TEXT Use a template instead of a prompt file.
-e, --env TEXT Set environment variables (KEY=VALUE or KEY).
--output TEXT Specify where to save the generated code.
--original-prompt PATH Original prompt file for incremental generation.
--incremental Force incremental patching.
--unit-test PATH Path to a unit test file for TDD.
--exclude-tests Do not automatically include test files.
--help Show this message and exit.
Proposed Fix
Update the test assertion from:
assert "Usage: cli generate [OPTIONS] PROMPT_FILE" in result.outputTo:
assert "Usage: cli generate [OPTIONS] [PROMPT_FILE]" in result.outputVerification
Tested on main branch at commit 0c5301c:
python -m pytest tests/test_core_cli.py::test_cli_command_help -v
# Result: FAILEDEnvironment
- Branch: main
- Commit: 0c5301c
- Python: 3.12.12
- pytest: 8.3.5
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working