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

Function test_argument_order

tests/test_shell_completion.py:113–127  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

111
112
113def test_argument_order():
114 cli = Command(
115 "cli",
116 params=[
117 Argument(["plain"]),
118 Argument(["c1"], type=Choice(["a1", "a2", "b"])),
119 Argument(["c2"], type=Choice(["c1", "c2", "d"])),
120 ],
121 )
122 # first argument has no completions
123 assert _get_words(cli, [], "") == []
124 assert _get_words(cli, [], "a") == []
125 # first argument filled, now completion can happen
126 assert _get_words(cli, ["x"], "a") == ["a1", "a2"]
127 assert _get_words(cli, ["x", "b"], "d") == ["d"]
128
129
130def test_argument_default():

Callers

nothing calls this directly

Calls 4

CommandClass · 0.90
ArgumentClass · 0.90
ChoiceClass · 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…