Example #1
0
 def test_check_bundle_should_failed_when_tag_ospkg_and_two_oses(self, mock_method):
     #Given
     jsonPath = "tests/integration/data/bundle/bundleFilesTagOSPkgWithTwoOses.json"
     #When
     bundle = generics_utils.check_json_syntax(jsonPath)
     bundle_utils.check_bundle(bundle)
     #Then
     mock_method.assert_called_with("The file 'iotop-0.6-2.el7.noarch.rpm' is tagged 'ospkg' but there is more than one os in [oses] attribute", "ERROR")
Example #2
0
 def test_check_bundle_should_succeed_when_no_restrictionRule(self):
     # Given
     jsonPath = "tests/integration/data/bundle/bundleWithoutRestrictionRule.json"
     # When
     bundle = generics_utils.check_json_syntax(jsonPath)
     bundle_utils.check_bundle(bundle)
     # Then
     self.assertIsNotNone(bundle)
Example #3
0
 def test_check_bundle_should_failed_when_no_files(self, mock_method):
     #Given
     jsonPath = "tests/integration/data/bundle/bundleWithoutFiles.json"
     #When
     bundle = generics_utils.check_json_syntax(jsonPath)
     bundle_utils.check_bundle(bundle)
     #Then
     mock_method.assert_called_with("no attribute [files] for [bundle]", "ERROR")
Example #4
0
 def test_check_bundle_should_failed_when_tag_bootscript_and_rights(self, mock_method):
     #Given
     jsonPath = "tests/integration/data/bundle/bundleFilesTagBootScriptKeyRights.json"
     #When
     bundle = generics_utils.check_json_syntax(jsonPath)
     bundle_utils.check_bundle(bundle)
     #Then
     mock_method.assert_called_with("There is the attribute [ownerGroup], [rights] or [symlink] for file 'cleanup_tmp.sh' but is not tagged as 'softwarefile'", "ERROR")
Example #5
0
 def test_check_bundle_should_failed_when_tag_softwarefile_and_bootorder(self, mock_method):
     #Given
     jsonPath = "tests/integration/data/bundle/bundleFilesTagSoftwareFileKeyBootOrder.json"
     #When
     bundle = generics_utils.check_json_syntax(jsonPath)
     bundle_utils.check_bundle(bundle)
     #Then
     mock_method.assert_called_with("There is the attribute [bootOrder] or [bootType] for file 'directoryTest' but is not tagged as 'bootscript'", "ERROR")
Example #6
0
 def test_check_bundle_should_succeed_when_empty_restrictionRule(self):
     # Given
     jsonPath = find_relative_path_for("tests/integration/data/bundle/bundleWithEmptyRestrictionRule.json")
     # When
     bundle = generics_utils.check_json_syntax(jsonPath)
     bundle_utils.check_bundle(bundle)
     # Then
     self.assertIsNotNone(bundle)
Example #7
0
 def test_check_bundle_should_succeed_when_empty_restrictionRule(self):
     # Given
     jsonPath = "tests/integration/data/bundle/bundleWithEmptyRestrictionRule.json"
     # When
     bundle = generics_utils.check_json_syntax(jsonPath)
     bundle_utils.check_bundle(bundle)
     # Then
     self.assertIsNotNone(bundle)
Example #8
0
 def test_check_bundle_should_failed_when_tag_bootscript_and_rights(self, mock_method):
     #Given
     jsonPath = "tests/integration/data/bundle/bundleFilesTagBootScriptKeyRights.json"
     #When
     bundle = generics_utils.check_json_syntax(jsonPath)
     bundle_utils.check_bundle(bundle)
     #Then
     mock_method.assert_called_with("There is the attribute [ownerGroup], [rights] or [symlink] for file 'cleanup_tmp.sh' but is not tagged as 'softwarefile'", "ERROR")
Example #9
0
 def test_check_bundle_should_failed_when_tag_ospkg_in_directory(self, mock_method):
     #Given
     jsonPath = "tests/integration/data/bundle/bundleFilesTagOSPkgInDirectory.json"
     #When
     bundle = generics_utils.check_json_syntax(jsonPath)
     bundle_utils.check_bundle(bundle)
     #Then
     mock_method.assert_called_with("The file 'iotop-0.6-2.el7.noarch.rpm, with tag 'ospkg' must be in the first level files section", "ERROR")
Example #10
0
 def test_check_bundle_should_failed_when_files_no_source(self, mock_method):
     #Given
     jsonPath = "tests/integration/data/bundle/bundleFilesWithoutSource.json"
     #When
     bundle = generics_utils.check_json_syntax(jsonPath)
     bundle_utils.check_bundle(bundle)
     #Then
     mock_method.assert_called_with("There is no attribute [source] for a [file]", "ERROR")
Example #11
0
 def test_check_bundle_should_failed_when_tag_softwarefile_and_bootorder(self, mock_method):
     #Given
     jsonPath = "tests/integration/data/bundle/bundleFilesTagSoftwareFileKeyBootOrder.json"
     #When
     bundle = generics_utils.check_json_syntax(jsonPath)
     bundle_utils.check_bundle(bundle)
     #Then
     mock_method.assert_called_with("There is the attribute [bootOrder] or [bootType] for file 'directoryTest' but is not tagged as 'bootscript'", "ERROR")
Example #12
0
 def test_check_bundle_should_failed_when_no_files(self, mock_method):
     #Given
     jsonPath = "tests/integration/data/bundle/bundleWithoutFiles.json"
     #When
     bundle = generics_utils.check_json_syntax(jsonPath)
     bundle_utils.check_bundle(bundle)
     #Then
     mock_method.assert_called_with("no attribute [files] for [bundle]", "ERROR")
Example #13
0
 def test_check_bundle_should_failed_when_files_no_name(self, mock_method):
     #Given
     jsonPath = find_relative_path_for("tests/integration/data/bundle/bundleFilesWithoutName.json")
     #When
     bundle = generics_utils.check_json_syntax(jsonPath)
     bundle_utils.check_bundle(bundle)
     #Then
     mock_method.assert_called_with("There is no attribute [name] for a [file]", "ERROR")
Example #14
0
 def test_check_bundle_should_failed_when_no_version(self, mock_method):
     #Given
     jsonPath = find_relative_path_for("tests/integration/data/bundle/bundleWithoutVersion.json")
     #When
     bundle = generics_utils.check_json_syntax(jsonPath)
     bundle_utils.check_bundle(bundle)
     #Then
     mock_method.assert_called_with("no attribute [version] for [bundle]", "ERROR")
Example #15
0
 def test_check_bundle_should_failed_when_files_no_source(self, mock_method):
     #Given
     jsonPath = "tests/integration/data/bundle/bundleFilesWithoutSource.json"
     #When
     bundle = generics_utils.check_json_syntax(jsonPath)
     bundle_utils.check_bundle(bundle)
     #Then
     mock_method.assert_called_with("There is no attribute [source] for a [file]", "ERROR")
Example #16
0
 def test_check_bundle_should_failed_when_tag_ospkg_in_directory(self, mock_method):
     #Given
     jsonPath = "tests/integration/data/bundle/bundleFilesTagOSPkgInDirectory.json"
     #When
     bundle = generics_utils.check_json_syntax(jsonPath)
     bundle_utils.check_bundle(bundle)
     #Then
     mock_method.assert_called_with("The file 'iotop-0.6-2.el7.noarch.rpm, with tag 'ospkg' must be in the first level files section", "ERROR")
Example #17
0
 def test_check_bundle_should_succeed_when_no_restrictionRule(self):
     # Given
     jsonPath = find_relative_path_for(
         "tests/integration/data/bundle/bundleWithoutRestrictionRule.json")
     # When
     bundle = generics_utils.check_json_syntax(jsonPath)
     bundle_utils.check_bundle(bundle)
     # Then
     self.assertIsNotNone(bundle)
Example #18
0
 def test_check_bundle_should_failed_when_files_no_name(self, mock_method):
     #Given
     jsonPath = find_relative_path_for(
         "tests/integration/data/bundle/bundleFilesWithoutName.json")
     #When
     bundle = generics_utils.check_json_syntax(jsonPath)
     bundle_utils.check_bundle(bundle)
     #Then
     mock_method.assert_called_with(
         "There is no attribute [name] for a [file]", "ERROR")
Example #19
0
 def test_check_bundle_should_failed_when_no_version(self, mock_method):
     #Given
     jsonPath = find_relative_path_for(
         "tests/integration/data/bundle/bundleWithoutVersion.json")
     #When
     bundle = generics_utils.check_json_syntax(jsonPath)
     bundle_utils.check_bundle(bundle)
     #Then
     mock_method.assert_called_with("no attribute [version] for [bundle]",
                                    "ERROR")
Example #20
0
 def test_check_bundle_should_succeed(self):
     #Given
     jsonPath = "tests/integration/data/bundle/bundleFull.json"
     #When
     bundle = generics_utils.check_json_syntax(jsonPath)
     bundle = bundle_utils.check_bundle(bundle)
     #Then
     self.assertIsNotNone(bundle)
Example #21
0
 def test_check_bundle_should_succeed(self):
     #Given
     jsonPath = "tests/integration/data/bundle/bundleFull.json"
     #When
     bundle = generics_utils.check_json_syntax(jsonPath)
     bundle = bundle_utils.check_bundle(bundle)
     #Then
     self.assertIsNotNone(bundle)