mirror of
https://git.zavage.net/Zavage-Software/smileyface.git
synced 2026-06-25 18:12:48 -06:00
test: add CLI --help smoke tests for every command
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
42b7a329c9
commit
f6bbb550d8
24
tests/test_cli.py
Normal file
24
tests/test_cli.py
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
from click.testing import CliRunner
|
||||||
|
|
||||||
|
from smileyface.cli import cli
|
||||||
|
|
||||||
|
|
||||||
|
def test_root_help():
|
||||||
|
result = CliRunner().invoke(cli, ["--help"])
|
||||||
|
assert result.exit_code == 0, result.output
|
||||||
|
assert "SmileyFace" in result.output
|
||||||
|
|
||||||
|
|
||||||
|
def test_every_command_help():
|
||||||
|
runner = CliRunner()
|
||||||
|
for name in cli.commands:
|
||||||
|
result = runner.invoke(cli, [name, "--help"])
|
||||||
|
assert result.exit_code == 0, f"`{name} --help` failed:\n{result.output}"
|
||||||
|
|
||||||
|
|
||||||
|
def test_scrape_subcommands_help():
|
||||||
|
runner = CliRunner()
|
||||||
|
scrape_group = cli.commands["scrape"]
|
||||||
|
for name in scrape_group.commands:
|
||||||
|
result = runner.invoke(cli, ["scrape", name, "--help"])
|
||||||
|
assert result.exit_code == 0, f"`scrape {name} --help` failed:\n{result.output}"
|
||||||
Loading…
Reference in New Issue
Block a user