Skip to content

Commit

Permalink
Issue-692 Don't fail validation when version string with no quotes (#694
Browse files Browse the repository at this point in the history
)
  • Loading branch information
MalikAtalla-AWS authored Mar 2, 2021
1 parent 95b5666 commit bc3cbf5
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/rpdk/core/contract/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class OperationStatus(AutoName):
FAILED = auto()


# pylint: disable=invalid-name
class HandlerErrorCode(AutoName):
NotUpdatable = auto()
InvalidRequest = auto()
Expand Down
2 changes: 1 addition & 1 deletion src/rpdk/core/fragment/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def __get_cfn_lint_matches(raw_fragment):
filename = "temporary_fragment.json"

with open(filename, "w") as outfile:
json.dump(raw_fragment, outfile, indent=4)
json.dump(raw_fragment, outfile, indent=4, default=str)

template = cfnlint.decode.cfn_json.load(filename)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
AWSTemplateFormatVersion: 2010-09-09
Resources:
WaitHandle:
Type: AWS::CloudFormation::WaitConditionHandle
6 changes: 6 additions & 0 deletions tests/fragments/test_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ def test_template_fragments_without_parameter_section_is_valid(template_fragment
)


def test_template_fragments_with_date_in_version(template_fragment):
__assert_validation_throws_no_error(
"template_with_date_in_version.yaml", template_fragment
)


def test_template_fragments_without_description(template_fragment):
schema = __generate_schema("template_without_description.json", template_fragment)

Expand Down

0 comments on commit bc3cbf5

Please sign in to comment.