diff --git a/tests/translator/input/error_invalid_document_empty_semantic_version.yaml b/tests/translator/input/error_invalid_document_empty_semantic_version.yaml new file mode 100644 index 0000000000..ec3b5bea0c --- /dev/null +++ b/tests/translator/input/error_invalid_document_empty_semantic_version.yaml @@ -0,0 +1,7 @@ +Resources: + helloworld: + Type: AWS::Serverless::Application + Properties: + Location: + ApplicationId: arn:aws:serverlessrepo:us-east-1:077246666028:applications/hello-world + SemanticVersion: diff --git a/tests/translator/output/error_invalid_document_empty_semantic_version.json b/tests/translator/output/error_invalid_document_empty_semantic_version.json new file mode 100644 index 0000000000..7b228c1be8 --- /dev/null +++ b/tests/translator/output/error_invalid_document_empty_semantic_version.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "errorMessage": "Invalid Serverless Application Specification document. Number of errors found: 1. Resource with id [helloworld] is invalid. Property 'SemanticVersion' cannot be blank." + } + ], + "errorMessage": "Invalid Serverless Application Specification document. Number of errors found: 1. Resource with id [helloworld] is invalid. Property 'SemanticVersion' cannot be blank." +} \ No newline at end of file diff --git a/tests/translator/test_translator.py b/tests/translator/test_translator.py index 6e1afe56b5..cb25ddfd03 100644 --- a/tests/translator/test_translator.py +++ b/tests/translator/test_translator.py @@ -438,7 +438,8 @@ def _generate_new_deployment_hash(self, logical_id, dict_to_hash, rest_api_to_sw 'error_function_policy_template_invalid_value', 'error_function_with_unknown_policy_template', 'error_function_with_invalid_policy_statement', - 'error_function_with_invalid_condition_name' + 'error_function_with_invalid_condition_name', + 'error_invalid_document_empty_semantic_version' ]) @patch('boto3.session.Session.region_name', 'ap-southeast-1') @patch('samtranslator.plugins.application.serverless_app_plugin.ServerlessAppPlugin._sar_service_call', mock_sar_service_call)