Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: copy resource metadata before normalizing the information in it #5904

Merged
merged 4 commits into from
Sep 14, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
remove redundant function & update test method name
  • Loading branch information
mndeveci committed Sep 8, 2023
commit 9cc57488e82c24fadaf25e4ceddc9b34fb01cbb7
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ def test_skip_normalizing_already_normalized_resource(self):
self.assertEqual("new path", template_data["Resources"]["Function1"]["Properties"]["Code"])
self.assertEqual("Function1", template_data["Resources"]["Function1"]["Metadata"]["SamResourceId"])

def test_referenced_data(self):
def test_with_referenced_metadata(self):
input_template = """
Resources:
FirstFunction:
Expand Down Expand Up @@ -488,9 +488,6 @@ def test_referenced_data(self):
template_dict = yaml_parse(input_template)
ResourceMetadataNormalizer.normalize(template_dict)

def _extract_sam_resource_id(template, resource_id):
return template.get("Resources", {}).get(resource_id, {}).get("Metadata", {}).get("SamResourceId")

self.assertEqual(
template_dict.get("Resources", {}).get("FirstFunction", {}).get("Metadata", {}).get("SamResourceId"),
"FirstFunction",
Expand Down