Example #1
0
 def test_check_extension_and_validate_yaml(self, mock_method):
     # Given
     yamlPath = "test.yml"
     # When
     hammr_utils.validate(yamlPath)
     # Then
     mock_method.assert_called_with(yamlPath, isJson=False)
Example #2
0
 def test_check_extension_and_validate_json(self, mock_method):
     # Given
     jsonPath = "test.json"
     # When
     hammr_utils.validate(jsonPath)
     # Then
     mock_method.assert_called_with(jsonPath, isJson=True)
Example #3
0
 def test_check_extension_and_validate_json(self, mock_method):
     #Given
     jsonPath = "test.json"
     #When
     hammr_utils.validate(jsonPath)
     #Then
     mock_method.assert_called_with(jsonPath, isJson=True)
Example #4
0
 def test_check_extension_and_validate_yaml(self, mock_method):
     #Given
     yamlPath = "test.yml"
     #When
     hammr_utils.validate(yamlPath)
     #Then
     mock_method.assert_called_with(yamlPath, isJson=False)
Example #5
0
    def test_validate_if_check_extension_is_json_return_false(self, mock_check_extension_is_json,
                                                              mock_validate_configurations_file):
        # Given
        json_path = "test.json"
        mock_check_extension_is_json.return_value = False

        # When
        hammr_utils.validate(json_path)

        # Then
        mock_validate_configurations_file.assert_called_with(json_path, isJson=False)