diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2017-08-23 17:32:14 -0700 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2017-08-23 17:35:46 -0700 |
commit | 5f96f0dffcc7dba76c1f1a96e624fa3ab46e7b6e (patch) | |
tree | 5e2c0f07b6f301d614f34fadcadbc640a8a0adba /tests | |
parent | c5d9def60e102b30cb72e8f32149c67c3765563c (diff) |
tests/commands/globals: Add tests for stdin handling
Diffstat (limited to 'tests')
-rw-r--r-- | tests/commands/global_test.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/commands/global_test.py b/tests/commands/global_test.py index c6b466c5..e93a11d3 100644 --- a/tests/commands/global_test.py +++ b/tests/commands/global_test.py @@ -25,6 +25,8 @@ import mock from alot.commands import globals as g_commands +from .. import utilities + class Stop(Exception): """exception for stopping testing of giant unmanagable functions.""" @@ -134,6 +136,19 @@ class TestExternalCommand(unittest.TestCase): cmd.apply(ui) ui.notify.assert_not_called() + @utilities.expected_failure + def test_no_spawn_no_stdin_attached(self): + ui = mock.Mock() + cmd = g_commands.ExternalCommand(u'test -t 0', refocus=False) + cmd.apply(ui) + ui.notify.assert_not_called() + + def test_no_spawn_stdin_attached(self): + ui = mock.Mock() + cmd = g_commands.ExternalCommand(u"test -t 0", stdin=u'0', refocus=False) + cmd.apply(ui) + ui.notify.assert_called_once_with('', priority='error') + def test_no_spawn_failure(self): ui = mock.Mock() cmd = g_commands.ExternalCommand(u'false', refocus=False) |