MCPcopy Create free account
hub / github.com/python-cmd2/cmd2 / test_resolve_completer_with_choices

Function test_resolve_completer_with_choices

tests/test_cmd2.py:2125–2138  ·  view source on GitHub ↗
(base_app: cmd2.Cmd)

Source from the content-addressed store, hash-verified

2123
2124
2125def test_resolve_completer_with_choices(base_app: cmd2.Cmd) -> None:
2126 from cmd2.pt_utils import Cmd2Completer
2127
2128 choices = ["apple", "banana", "cherry"]
2129 completer = base_app._resolve_completer(choices=choices)
2130 assert isinstance(completer, Cmd2Completer)
2131
2132 # Verify contents
2133 settings = completer.custom_settings
2134 assert settings is not None
2135
2136 action = settings.parser._actions[-1]
2137 assert action.choices == choices
2138 assert not settings.preserve_quotes
2139
2140
2141def test_resolve_completer_with_choices_provider(base_app: cmd2.Cmd) -> None:

Callers

nothing calls this directly

Calls 1

_resolve_completerMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…