def testGitIsNotInstalled(self): with mock.patch.object(packaging, '_run_shell_command') as _command: _command.side_effect = OSError self.assertEqual(False, packaging._git_is_installed())
def testGitIsInstalled(self): with mock.patch.object(packaging, '_run_shell_command') as _command: _command.return_value = 'git version 1.8.4.1' self.assertEqual(True, packaging._git_is_installed())