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

Function test_resolve_completer_with_choices_provider

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

Source from the content-addressed store, hash-verified

2139
2140
2141def test_resolve_completer_with_choices_provider(base_app: cmd2.Cmd) -> None:
2142 from cmd2.pt_utils import Cmd2Completer
2143
2144 mock_provider = mock.MagicMock()
2145 completer = base_app._resolve_completer(choices_provider=mock_provider)
2146 assert isinstance(completer, Cmd2Completer)
2147
2148 # Verify contents
2149 settings = completer.custom_settings
2150 assert settings is not None
2151
2152 action = settings.parser._actions[-1]
2153 assert action.get_choices_provider() == mock_provider
2154 assert not settings.preserve_quotes
2155
2156
2157def test_resolve_completer_with_completer(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…