Exemple #1
0
 def test_get_identifier_from_recipe_file_returns_none(
         self, mock_load, mock_read):
     """get_identifier_from_recipe_file should return None if no identifier."""
     mock_read.return_value = self.download_struct
     del mock_read.return_value["Identifier"]
     id = autopkglib.get_identifier_from_recipe_file("fake")
     self.assertIsNone(id)
Exemple #2
0
 def test_get_identifier_from_recipe_file_returns_none(self, mock_read):
     """get_identifier_from_recipe-file should return None if no identifier."""
     mock_read.return_value = plistlib.readPlistFromString(
         self.download_recipe)
     del mock_read.return_value["Identifier"]
     id = autopkglib.get_identifier_from_recipe_file("fake")
     self.assertIsNone(id)
Exemple #3
0
 def test_get_identifier_from_recipe_file_returns_identifier(
         self, mock_isfile, mock_load, mock_file):
     """get_identifier_from_recipe_file should return identifier."""
     mock_isfile.return_value = True
     mock_load.return_value = self.download_struct
     id = autopkglib.get_identifier_from_recipe_file("fake")
     self.assertEqual(id, "com.github.autopkg.download.googlechrome")
Exemple #4
0
 def test_get_identifier_from_recipe_file_returns_identifier(
         self, mock_read):
     """get_identifier_from_recipe-file should return identifier."""
     mock_read.return_value = plistlib.readPlistFromString(
         self.download_recipe)
     id = autopkglib.get_identifier_from_recipe_file("fake")
     self.assertEqual(id, "com.github.autopkg.download.googlechrome")