File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -3378,3 +3378,18 @@ def test_bottom_toolbar(base_app):
33783378 base_app .completion_hint = 'hint '
33793379 base_app ._bottom_toolbar ()
33803380 mock_ansi .assert_called_with ('hint' )
3381+
3382+
3383+ def test_multiline_complete_statement_keyboard_interrupt (multiline_app , monkeypatch ):
3384+ # Mock read_input to raise KeyboardInterrupt
3385+ read_input_mock = mock .MagicMock (name = 'read_input' , side_effect = KeyboardInterrupt )
3386+ monkeypatch .setattr ("cmd2.Cmd.read_input" , read_input_mock )
3387+
3388+ # Mock poutput to verify ^C is printed
3389+ poutput_mock = mock .MagicMock (name = 'poutput' )
3390+ monkeypatch .setattr (multiline_app , 'poutput' , poutput_mock )
3391+
3392+ with pytest .raises (exceptions .EmptyStatement ):
3393+ multiline_app ._complete_statement ('orate incomplete' )
3394+
3395+ poutput_mock .assert_called_with ('^C' )
You can’t perform that action at this time.
0 commit comments