@@ -133,13 +133,11 @@ def test_auto_skip_infra_sync_basic(self, session_mock, get_template_mock, local
133133 infra_sync_executor = InfraSyncExecutor (
134134 self .build_context , self .package_context , self .deploy_context , self .sync_context
135135 )
136- infra_sync_executor ._cfn_client .get_template .return_value = {
137- "TemplateBody" : """{
136+ infra_sync_executor ._cfn_client .get_template .return_value = {"TemplateBody" : """{
138137 "Resources": {
139138 "ServerlessFunction": {"Type": "AWS::Serverless::Function", "Properties": {"CodeUri": "https://s3"}}
140139 }
141- }"""
142- }
140+ }""" }
143141
144142 self .assertTrue (infra_sync_executor ._auto_skip_infra_sync ("path" , "path2" , "stack_name" ))
145143 self .assertEqual (infra_sync_executor .code_sync_resources , {ResourceIdentifier ("ServerlessFunction" )})
@@ -233,8 +231,7 @@ def test_auto_skip_infra_sync_all_resources(self, session_mock, get_template_moc
233231 infra_sync_executor = InfraSyncExecutor (
234232 self .build_context , self .package_context , self .deploy_context , self .sync_context
235233 )
236- infra_sync_executor ._cfn_client .get_template .return_value = {
237- "TemplateBody" : """{
234+ infra_sync_executor ._cfn_client .get_template .return_value = {"TemplateBody" : """{
238235 "Resources": {
239236 "ServerlessFunction": {
240237 "Type": "AWS::Serverless::Function",
@@ -272,8 +269,7 @@ def test_auto_skip_infra_sync_all_resources(self, session_mock, get_template_moc
272269 "Properties": {"DefinitionS3Location": "s3://location"},
273270 },
274271 }
275- }"""
276- }
272+ }""" }
277273
278274 self .assertTrue (infra_sync_executor ._auto_skip_infra_sync ("path" , "path2" , "stack_name" ))
279275 self .assertEqual (
@@ -336,24 +332,20 @@ def test_auto_skip_infra_sync_nested_stack(self, session_mock, get_template_mock
336332 self .build_context , self .package_context , self .deploy_context , self .sync_context
337333 )
338334 infra_sync_executor ._cfn_client .get_template .side_effect = [
339- {
340- "TemplateBody" : f"""{{
335+ {"TemplateBody" : f"""{{
341336 "Resources": {{
342337 "ServerlessApplication": {{
343338 "Type": "AWS::Serverless::Application",
344339 "Properties": {{"Location": "{ str (Path ("local" ) / "template.yaml" )} "}} }}
345340 }}
346- }}"""
347- },
348- {
349- "TemplateBody" : """{
341+ }}""" },
342+ {"TemplateBody" : """{
350343 "Resources": {
351344 "ServerlessFunction": {
352345 "Type": "AWS::Serverless::Function",
353346 "Properties": {"CodeUri": "function/"}}
354347 }
355- }"""
356- },
348+ }""" },
357349 ]
358350
359351 infra_sync_executor ._cfn_client .describe_stack_resource .return_value = {
@@ -414,16 +406,14 @@ def test_auto_skip_infra_sync_nested_stack_with_sar(
414406 self .build_context , self .package_context , self .deploy_context , self .sync_context
415407 )
416408 infra_sync_executor ._cfn_client .get_template .side_effect = [
417- {
418- "TemplateBody" : """{
409+ {"TemplateBody" : """{
419410 "Resources": {
420411 "ServerlessApplication": {
421412 "Type": "AWS::Serverless::Application",
422413 "Properties": {"Location": {"ApplicationId": "sar_id", "SemanticVersion": "version"}},
423414 }
424415 }
425- }"""
426- },
416+ }""" },
427417 ]
428418
429419 infra_sync_executor ._cfn_client .describe_stack_resource .return_value = {
@@ -466,23 +456,19 @@ def test_auto_skip_infra_sync_http_template_location(self, session_mock, get_tem
466456 self .build_context , self .package_context , self .deploy_context , self .sync_context
467457 )
468458 infra_sync_executor ._cfn_client .get_template .side_effect = [
469- {
470- "TemplateBody" : """{
459+ {"TemplateBody" : """{
471460 Resources: {
472461 "NestedStack": {
473462 "Type": "AWS::CloudFormation::Stack",
474463 "Properties": {"TemplateURL": "https://s3.com/bucket/key"}
475464 }
476465 }
477- }"""
478- },
479- {
480- "TemplateBody" : """{
466+ }""" },
467+ {"TemplateBody" : """{
481468 "Resources": {
482469 "ServerlessFunction": {"Type": "AWS::Serverless::Function", "Properties": {"CodeUri": "local/"}}
483470 }
484- }"""
485- },
471+ }""" },
486472 ]
487473
488474 infra_sync_executor ._cfn_client .describe_stack_resource .return_value = {
@@ -554,13 +540,11 @@ def test_auto_skip_infra_sync_param_overrides(
554540 infra_sync_executor = InfraSyncExecutor (
555541 self .build_context , self .package_context , self .deploy_context , self .sync_context
556542 )
557- infra_sync_executor ._cfn_client .get_template .return_value = {
558- "TemplateBody" : """{
543+ infra_sync_executor ._cfn_client .get_template .return_value = {"TemplateBody" : """{
559544 "Resources": {
560545 "ServerlessFunction": {"Type": "AWS::Serverless::Function", "Properties": {"CodeUri": "https://s3"}}
561546 }
562- }"""
563- }
547+ }""" }
564548
565549 infra_sync_executor ._get_stack_parameters = MagicMock ()
566550
0 commit comments