[tests/util] Add test for execute with wait=False

This commit is contained in:
Tobi-wan Kenobi 2017-03-04 11:35:46 +01:00
parent 7be8df222d
commit f0013c7581

View file

@ -37,6 +37,12 @@ class TestUtil(unittest.TestCase):
self.popen.mock.popen.assert_call(self.some_command_with_args) self.popen.mock.popen.assert_call(self.some_command_with_args)
self.assertTrue(self.popen.mock.communicate.called) self.assertTrue(self.popen.mock.communicate.called)
def test_execute_nowait(self):
execute(self.some_command_with_args, False)
self.assertTrue(self.popen.mock.popen.called)
self.popen.mock.popen.assert_call(self.some_command_with_args)
self.assertFalse(self.popen.mock.communicate.called)
def test_execute_utf8(self): def test_execute_utf8(self):
self.popen.mock.communicate.return_value = [ self.some_utf8, None ] self.popen.mock.communicate.return_value = [ self.some_utf8, None ]
self.test_execute() self.test_execute()