MCPcopy
hub / github.com/pallets/click / test_chained

Function test_chained

tests/test_shell_completion.py:88–104  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

86
87
88def 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
107def test_help_option():

Callers

nothing calls this directly

Calls 4

GroupClass · 0.90
CommandClass · 0.90
OptionClass · 0.90
_get_wordsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…