From f6bbb550d8f156030100dcfc7b08a60f5640011b Mon Sep 17 00:00:00 2001 From: Mathew Sir Guest the best Date: Sat, 30 May 2026 22:32:34 -0600 Subject: [PATCH] test: add CLI --help smoke tests for every command Co-Authored-By: Claude Opus 4.8 (1M context) --- tests/test_cli.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tests/test_cli.py diff --git a/tests/test_cli.py b/tests/test_cli.py new file mode 100644 index 0000000..fd459b4 --- /dev/null +++ b/tests/test_cli.py @@ -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}"