def test_has_successfull_false(self): shell = Shell(TestShell.cmd, stdout=True) exception = CalledProcessError(returncode=1, cmd='') with patch('subprocess.check_output', side_effect=exception): self.assertFalse(shell.was_successful())
def test_was_successfull_true(self): shell = Shell(TestShell.cmd, stdout=True) with patch('subprocess.check_output', return_value=''): self.assertTrue(shell.was_successful())