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

Function test_option_optional

tests/test_shell_completion.py:177–188  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

175
176
177def test_option_optional():
178 cli = Command(
179 "cli",
180 add_help_option=False,
181 params=[
182 Option(["--name"], is_flag=False, flag_value="value"),
183 Option(["--flag"], is_flag=True),
184 ],
185 )
186 assert _get_words(cli, ["--name"], "") == []
187 assert _get_words(cli, ["--name"], "-") == ["--flag"]
188 assert _get_words(cli, ["--name", "--flag"], "-") == []
189
190
191@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 3

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…