MCPcopy Create free account
hub / github.com/IBM/mcp-cli / test_chat_keyboard_interrupt

Method test_chat_keyboard_interrupt

tests/cli/test_main_coverage.py:1079–1089  ·  view source on GitHub ↗
(self, mock_opts, mock_theme, mock_restore, runner)

Source from the content-addressed store, hash-verified

1077 @patch("mcp_cli.main.set_theme")
1078 @patch("mcp_cli.main.process_options", return_value=_make_process_options_return())
1079 def test_chat_keyboard_interrupt(self, mock_opts, mock_theme, mock_restore, runner):
1080 from mcp_cli.main import app
1081
1082 def _raise_keyboard(coro):
1083 coro.close()
1084 raise KeyboardInterrupt
1085
1086 mm = _make_model_manager()
1087 with patch("mcp_cli.model_management.ModelManager", return_value=mm):
1088 with patch("asyncio.run", side_effect=_raise_keyboard):
1089 runner.invoke(app, ["chat"])
1090
1091 @patch("mcp_cli.main.restore_terminal")
1092 @patch("mcp_cli.main.set_theme")

Callers

nothing calls this directly

Calls 1

_make_model_managerFunction · 0.70

Tested by

no test coverage detected