@@ -127,16 +127,32 @@ def test_image___get_root_device_snapshot_id(root_device_name, block_device_mapp
127127
128128
129129@pytest .mark .parametrize (
130- "imagename,partition,called_mod_image,called_mod_snapshot,called_start_change_set,called_put_parameter" ,
130+ (
131+ "imagename" ,
132+ "partition" ,
133+ "called_mod_image" ,
134+ "called_mod_snapshot" ,
135+ "called_start_change_set" ,
136+ "called_put_parameter" ,
137+ "called_sns_publish" ,
138+ ),
131139 [
132- ("test-image-6" , "aws" , True , True , False , False ),
133- ("test-image-7" , "aws" , False , False , False , False ),
134- ("test-image-8" , "aws" , True , True , True , True ),
135- ("test-image-8" , "aws-cn" , True , True , False , True ),
140+ ("test-image-6" , "aws" , True , True , False , False , False ),
141+ ("test-image-7" , "aws" , False , False , False , False , False ),
142+ ("test-image-8" , "aws" , True , True , True , True , False ),
143+ ("test-image-8" , "aws-cn" , True , True , False , True , False ),
144+ ("test-image-10" , "aws" , False , False , False , False , True ),
145+ ("test-image-11" , "aws" , False , False , False , False , True ),
136146 ],
137147)
138148def test_image_publish (
139- imagename , partition , called_mod_image , called_mod_snapshot , called_start_change_set , called_put_parameter
149+ imagename ,
150+ partition ,
151+ called_mod_image ,
152+ called_mod_snapshot ,
153+ called_start_change_set ,
154+ called_put_parameter ,
155+ called_sns_publish ,
140156):
141157 """
142158 Test the publish() for a given image
@@ -167,13 +183,15 @@ def test_image_publish(
167183 "Regions" : [{"RegionName" : "eu-central-1" }, {"RegionName" : "us-east-1" }]
168184 }
169185 instance .list_buckets .return_value = {"Buckets" : [{"Name" : "bucket1" }]}
186+ instance .list_topics .return_value = {"Topics" : [{"TopicArn" : "arn:aws:sns:topic1" }]}
170187 ctx = context .Context (curdir / "fixtures/config1.yaml" , None )
171188 img = image .Image (ctx , imagename )
172189 img .publish ()
173190 assert instance .modify_image_attribute .called == called_mod_image
174191 assert instance .modify_snapshot_attribute .called == called_mod_snapshot
175192 assert instance .start_change_set .called == called_start_change_set
176193 assert instance .put_parameter .called == called_put_parameter
194+ assert instance .publish .called == called_sns_publish
177195
178196
179197def test_image__get_zero_images ():
0 commit comments