Пример #1
0
 def test_returns_None_if_git_not_found(self):
     call_and_check = self.patch(shell, "call_and_check")
     call_and_check.side_effect = FileNotFoundError()
     self.assertIsNone(version._get_maas_repo_hash())
Пример #2
0
 def test_returns_hash_for_this_branch(self):
     commit_hash = version._get_maas_repo_hash()
     self.assertIsInstance(commit_hash, str)
Пример #3
0
 def test_returns_None_if_git_crashes(self):
     call_and_check = self.patch(shell, "call_and_check")
     call_and_check.side_effect = shell.ExternalProcessError(2, "cmd")
     self.assertIsNone(version._get_maas_repo_hash())