Skip to content
Myr

add test for flag with naargs option auto completion

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

authored by saipraneeth · committed by Andreas Backx · parent 098f614 · Browse files · 1 file+13 added−0 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−0 removed

  • tests:+13 added−0 removed

1 file+13 added−0 removed

modified:tests/test_shell_completion.py+13 added
186 unmodified lines
187 # flag option doesn't take value, use choice argument188 assert _get_words(cli, ["--on"], "a") == ["a1", "a2"]189190191def test_flag_option_with_nargs_option():192 cli = Command(193 "cli",194 add_help_option=False,195 params=[196 Argument(["a"], type=Choice(["a1", "a2", "b"])),197 Option(["--flag"], is_flag=True),198 Option(["-c"], type=Choice(["p", "q"]), nargs=2),199 ],200 )201 assert _get_words(cli, ["a1", "--flag", "-c"], "") == ["p", "q"]202203204def test_option_custom():205 def custom(ctx, param, incomplete):206 return [incomplete.upper()]207
248 unmodified lines