(multiline_app, monkeypatch)
| 4300 | |
| 4301 | |
| 4302 | def test_multiline_complete_statement_keyboard_interrupt(multiline_app, monkeypatch): |
| 4303 | # Mock _read_command_line to raise KeyboardInterrupt |
| 4304 | read_command_mock = mock.MagicMock(name="_read_command_line", side_effect=KeyboardInterrupt) |
| 4305 | monkeypatch.setattr("cmd2.Cmd._read_command_line", read_command_mock) |
| 4306 | |
| 4307 | # Mock poutput to verify ^C is printed |
| 4308 | poutput_mock = mock.MagicMock(name="poutput") |
| 4309 | monkeypatch.setattr(multiline_app, "poutput", poutput_mock) |
| 4310 | |
| 4311 | with pytest.raises(exceptions.EmptyStatement): |
| 4312 | multiline_app._complete_statement("orate incomplete") |
| 4313 | |
| 4314 | poutput_mock.assert_called_with("^C") |
| 4315 | |
| 4316 | |
| 4317 | def test_create_main_session_no_console_error(monkeypatch): |
nothing calls this directly
no test coverage detected
searching dependent graphs…