summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2021-04-30 12:41:02 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2021-04-30 13:12:23 -0400
commit79bf87d1e333ea5fe0dfeb61c707eb9bddfd0255 (patch)
tree1e04c689b17f752732c67a10bcc76cb4cf4bee1a /tests
parent37d415b4bbfd6efd383a20062df68f627451ccf7 (diff)
downloadcmd2-git-79bf87d1e333ea5fe0dfeb61c707eb9bddfd0255.tar.gz
Removed cmd2.Cmd.quit_on_sigint.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/test_cmd2.py27
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()