MCPcopy Index your code
hub / github.com/python-cmd2/cmd2 / test_py_completion_setup_libedit

Function test_py_completion_setup_libedit

tests/test_py_completion.py:25–37  ·  view source on GitHub ↗
(base_app)

Source from the content-addressed store, hash-verified

23
24
25def test_py_completion_setup_libedit(base_app):
26 # Mock readline and rlcompleter
27 mock_readline = mock.MagicMock()
28 mock_readline.__doc__ = "libedit"
29 mock_rlcompleter = mock.MagicMock()
30
31 with mock.patch.dict(sys.modules, {"readline": mock_readline, "rlcompleter": mock_rlcompleter}):
32 interp = InteractiveConsole()
33 base_app._set_up_py_shell_env(interp)
34
35 # Verify completion setup for LibEdit
36 mock_readline.parse_and_bind.assert_called_with("bind ^I rl_complete")
37 mock_readline.set_completer.assert_called()
38
39
40def test_py_completion_restore(base_app):

Callers

nothing calls this directly

Calls 1

_set_up_py_shell_envMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…