diff options
| author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2021-04-30 12:41:02 -0400 |
|---|---|---|
| committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2021-04-30 13:12:23 -0400 |
| commit | 79bf87d1e333ea5fe0dfeb61c707eb9bddfd0255 (patch) | |
| tree | 1e04c689b17f752732c67a10bcc76cb4cf4bee1a /tests | |
| parent | 37d415b4bbfd6efd383a20062df68f627451ccf7 (diff) | |
| download | cmd2-git-79bf87d1e333ea5fe0dfeb61c707eb9bddfd0255.tar.gz | |
Removed cmd2.Cmd.quit_on_sigint.
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() |
