diff options
Diffstat (limited to 'tests')
| -rwxr-xr-x | tests/test_cmd2.py | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py index 64237f09..cfa30830 100755 --- a/tests/test_cmd2.py +++ b/tests/test_cmd2.py @@ -962,36 +962,13 @@ def say_app(): return app -def test_interrupt_quit(say_app): - say_app.quit_on_sigint = True - - # Mock out the input call so we don't actually wait for a user's response on stdin - m = mock.MagicMock(name='input') - m.side_effect = ['say hello', KeyboardInterrupt(), 'say goodbye', 'eof'] - builtins.input = m - - try: - say_app.cmdloop() - except KeyboardInterrupt: - pass - - # And verify the expected output to stdout - out = say_app.stdout.getvalue() - assert out == 'hello\n' - - -def test_interrupt_noquit(say_app): - say_app.quit_on_sigint = False - +def test_ctrl_c_at_prompt(say_app): # Mock out the input call so we don't actually wait for a user's response on stdin m = mock.MagicMock(name='input') m.side_effect = ['say hello', KeyboardInterrupt(), 'say goodbye', 'eof'] builtins.input = m - try: - say_app.cmdloop() - except KeyboardInterrupt: - pass + say_app.cmdloop() # And verify the expected output to stdout out = say_app.stdout.getvalue() |
