Skip to content

Commit 31cc0f9

Browse files
jadhavmanojpraneetap
authored andcommitted
test: added test cases for semantic version check (#929)
1 parent a01fae5 commit 31cc0f9

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Resources:
2+
helloworld:
3+
Type: AWS::Serverless::Application
4+
Properties:
5+
Location:
6+
ApplicationId: arn:aws:serverlessrepo:us-east-1:077246666028:applications/hello-world
7+
SemanticVersion:
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"errors": [
3+
{
4+
"errorMessage": "Invalid Serverless Application Specification document. Number of errors found: 1. Resource with id [helloworld] is invalid. Property 'SemanticVersion' cannot be blank."
5+
}
6+
],
7+
"errorMessage": "Invalid Serverless Application Specification document. Number of errors found: 1. Resource with id [helloworld] is invalid. Property 'SemanticVersion' cannot be blank."
8+
}

tests/translator/test_translator.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,8 @@ def _generate_new_deployment_hash(self, logical_id, dict_to_hash, rest_api_to_sw
438438
'error_function_policy_template_invalid_value',
439439
'error_function_with_unknown_policy_template',
440440
'error_function_with_invalid_policy_statement',
441-
'error_function_with_invalid_condition_name'
441+
'error_function_with_invalid_condition_name',
442+
'error_invalid_document_empty_semantic_version'
442443
])
443444
@patch('boto3.session.Session.region_name', 'ap-southeast-1')
444445
@patch('samtranslator.plugins.application.serverless_app_plugin.ServerlessAppPlugin._sar_service_call', mock_sar_service_call)

0 commit comments

Comments
 (0)