def test_git_raise_giterrorexception(self, mock_wait, mock_popen): self.assertRaises(GitErrorException, lambda: git.git2(['log']))
def test_git_ok(self, mock_wait, mock_popen): self.assertEqual(('foo1', 'bar1', 0), git.git2(['log']))
def test_git_raise_gitcallexception(self, mock_wait, mock_popen): self.assertRaises(GitCallException, lambda: git.git2(''))
try: print("-" * 30 + "Run git1 - raise GitCallException:") pprint(git.git1('')) except GitCallException as e: print e.message try: print("-" * 30 + "Run git1 - raise GitErrorException:") pprint(git.git1(['asdasdasd'])) except GitErrorException as e: print e.message print("-" * 30 + "Run git2 - successful:") pprint(git.git2(['status', '-s'])) try: print("-" * 30 + "Run git2 - raise TypeError:") pprint(git.git2()) except TypeError as e: print e.message try: print("-" * 30 + "Run git2 - raise GitCallException:") pprint(git.git2('')) except GitCallException as e: print e.message try: print("-" * 30 + "Run git2 - raise GitErrorException:")