diff --git a/tests/test_git_command.py b/tests/test_git_command.py index 21caa7f42..dccc83106 100644 --- a/tests/test_git_command.py +++ b/tests/test_git_command.py @@ -65,60 +65,6 @@ class GitCommandTest(unittest.TestCase): ) -class GitCommandWaitTest(unittest.TestCase): - """Tests the GitCommand class .Wait()""" - - def setUp(self): - class MockPopen: - rc = 0 - - def __init__(self): - self.stdout = io.BufferedReader(io.BytesIO()) - self.stderr = io.BufferedReader(io.BytesIO()) - - def communicate( - self, input: str = None, timeout: float = None - ) -> [str, str]: - """Mock communicate fn.""" - return ["", ""] - - def wait(self, timeout=None): - return self.rc - - self.popen = popen = MockPopen() - - def popen_mock(*args, **kwargs): - return popen - - def realpath_mock(val): - return val - - mock.patch.object(subprocess, "Popen", side_effect=popen_mock).start() - - mock.patch.object( - os.path, "realpath", side_effect=realpath_mock - ).start() - - def tearDown(self): - mock.patch.stopall() - - def test_raises_when_verify_non_zero_result(self): - self.popen.rc = 1 - r = git_command.GitCommand(None, ["status"], verify_command=True) - with self.assertRaises(git_command.GitCommandError): - r.Wait() - - def test_returns_when_no_verify_non_zero_result(self): - self.popen.rc = 1 - r = git_command.GitCommand(None, ["status"], verify_command=False) - self.assertEqual(1, r.Wait()) - - def test_default_returns_non_zero_result(self): - self.popen.rc = 1 - r = git_command.GitCommand(None, ["status"]) - self.assertEqual(1, r.Wait()) - - class GitCommandStreamLogsTest(unittest.TestCase): """Tests the GitCommand class stderr log streaming cases."""