()
| 86 | |
| 87 | |
| 88 | def test_chained(): |
| 89 | cli = Group( |
| 90 | "cli", |
| 91 | chain=True, |
| 92 | commands=[ |
| 93 | Command("set", params=[Option(["-y"])]), |
| 94 | Command("start"), |
| 95 | Group("get", commands=[Command("full")]), |
| 96 | ], |
| 97 | ) |
| 98 | assert _get_words(cli, [], "") == ["get", "set", "start"] |
| 99 | assert _get_words(cli, [], "s") == ["set", "start"] |
| 100 | assert _get_words(cli, ["set", "start"], "") == ["get"] |
| 101 | # subcommands and parent subcommands |
| 102 | assert _get_words(cli, ["get"], "") == ["full", "set", "start"] |
| 103 | assert _get_words(cli, ["get", "full"], "") == ["set", "start"] |
| 104 | assert _get_words(cli, ["get"], "s") == ["set", "start"] |
| 105 | |
| 106 | |
| 107 | def test_help_option(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…