Skip to content
Myr

parametrize test

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Lord · committed by David Lord · parent ac6a2ac · Browse files · 1 file+13 added−7 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+13 added−7 removed

  • tests:+13 added−7 removed

1 file+13 added−7 removed

modified:tests/test_shell_completion.py+13 added-7 removed
38 unmodified lines
39 assert _get_words(cli, [], "") == ["x", "y"]40 assert _get_words(cli, [], "-") == ["-a", "--help"]414243def test_nested_group():43@pytest.mark.parametrize(44 ("args", "word", "expect"),45 [46 ([], "", ["get"]),47 (["get"], "", ["full"]),48 (["get", "full"], "", ["data"]),49 (["get", "full"], "-", ["--verbose", "--help"]),50 (["get", "full", "data"], "", []),51 (["get", "full", "data"], "-", ["-a", "--help"]),52 ],53)54def test_nested_group(args: list[str], word: str, expect: list[str]) -> None:55 cli = Group(56 "cli",57 commands=[58 Group(
7 unmodified lines
66 ],67 )68 ],69 )59 assert _get_words(cli, [], "") == ["get"]60 assert _get_words(cli, ["get"], "") == ["full"]61 assert _get_words(cli, ["get", "full"], "") == ["data"]62 assert _get_words(cli, ["get", "full"], "-") == ["--verbose", "--help"]63 assert _get_words(cli, ["get", "full", "data"], "") == []64 assert _get_words(cli, ["get", "full", "data"], "-") == ["-a", "--help"]70 assert _get_words(cli, args, word) == expect717273def test_group_command_same_option():74 cli = Group(
398 unmodified lines