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}"