@@ -104,11 +104,18 @@ def test_simple_update_two_resources(
104104
105105 res .destroy ()
106106
107- @markers .aws .needs_fixing
108- def test_deleting_resource (self , aws_client : ServiceLevelClientFactory , deploy_cfn_template ):
107+ @markers .aws .validated
108+ # TODO: the error response is incorrect, however the test is otherwise validated and raises
109+ # an error because the SSM parameter has been deleted (removed from the stack).
110+ @markers .snapshot .skip_snapshot_verify (paths = ["$..Error.Message" , "$..message" ])
111+ @pytest .mark .skipif (
112+ condition = not is_v2_engine () and not is_aws_cloud (), reason = "Test fails with the old engine"
113+ )
114+ def test_deleting_resource (
115+ self , aws_client : ServiceLevelClientFactory , deploy_cfn_template , snapshot
116+ ):
109117 parameter_name = "my-parameter"
110118 value1 = "foo"
111- stack_name = f"stack-{ short_uid ()} "
112119
113120 t1 = {
114121 "Resources" : {
@@ -130,20 +137,18 @@ def test_deleting_resource(self, aws_client: ServiceLevelClientFactory, deploy_c
130137 },
131138 }
132139
133- res = deploy_cfn_template (stack_name = stack_name , template = json .dumps (t1 ), is_update = False )
140+ stack = deploy_cfn_template (template = json .dumps (t1 ))
134141 found_value = aws_client .ssm .get_parameter (Name = parameter_name )["Parameter" ]["Value" ]
135142 assert found_value == value1
136143
137144 t2 = copy .deepcopy (t1 )
138145 del t2 ["Resources" ]["MyParameter2" ]
139146
140- deploy_cfn_template (stack_name = stack_name , template = json .dumps (t2 ), is_update = True )
147+ deploy_cfn_template (stack_name = stack . stack_name , template = json .dumps (t2 ), is_update = True )
141148 with pytest .raises (ClientError ) as exc_info :
142- aws_client .ssm .get_parameter (Name = parameter_name )[ "Parameter" ][ "Value" ]
149+ aws_client .ssm .get_parameter (Name = parameter_name )
143150
144- assert f"Parameter { parameter_name } not found" in str (exc_info .value )
145-
146- res .destroy ()
151+ snapshot .match ("get-parameter-error" , exc_info .value .response )
147152
148153
149154@markers .aws .validated
0 commit comments