示例#1
0
 def test_get_release_from_an_invalid_version_file(self, *args):
     """
     Get release from the version.json file that is supposed to exists (and
     be formatted as expected) as we mock the open function
     """
     with self.assertRaises(KeyError):
         get_release()
示例#2
0
 def test_returns_default_without_version_file_or_git_repository(
         self, *args):
     """
     When no version.json file exists nor a Git repository, we expect that
     get_release() returns the default value
     """
     self.assertEqual(get_release(), "NA")
示例#3
0
 def test_get_release_from_git_repository(self, *args):
     """
     Get release from the local git repository
     """
     self.assertEqual(get_release(), "3ba84e7")
示例#4
0
 def test_get_release_from_a_valid_version_file(self, *args):
     """
     Get release from the version.json file that is supposed to exists (and
     be formatted as expected) as we mock the open function
     """
     self.assertEqual(get_release(), "3ba84e7")