2020
2121
2222test_run_params_matrix : tuple [
23- tuple [list [str ], list [str ], str , str , str , str , str , bool ]
23+ tuple [list [str ], list [str ], str , str , str , str , str , bool ], ...
2424] = (
2525 # Images | Tags | Source | Destination | User ID | Group ID | Group Name | Dry Run
2626 # Default settings
2727 (images , [], "" , "" , "" , "" , "" , False ),
28+ (
29+ images ,
30+ [
31+ "latest" ,
32+ "dev" ,
33+ ],
34+ "" ,
35+ "docker.io" ,
36+ "12345" ,
37+ "34567" ,
38+ "my-group" ,
39+ False ,
40+ ),
41+ (
42+ images ,
43+ [
44+ "latest" ,
45+ "dev" ,
46+ ],
47+ "" ,
48+ "docker.io" ,
49+ "12345" ,
50+ "34567" ,
51+ "my-group" ,
52+ True ,
53+ ),
2854)
2955
3056
@@ -129,7 +155,9 @@ def test_run(
129155 )
130156 mock_build .assert_has_calls (expected_build_calls , any_order = True )
131157
158+ # Check that 'tag_image' was called with the correct arguments
132159 if other_tags :
160+ assert mock_tag .call_count == len (images ) * len (other_tags )
133161 expected_tag_calls = (
134162 call (
135163 image_path = image ,
@@ -139,3 +167,20 @@ def test_run(
139167 for image in built_images
140168 )
141169 mock_tag .assert_has_calls (expected_tag_calls , any_order = True )
170+
171+ # Check that 'push_images' was called with the correct arguments
172+ mock_push .assert_called_once_with (
173+ call (
174+ images = images_to_push ,
175+ dry_run = dry_run if dry_run else def_dry_run ,
176+ ),
177+ any_order = True ,
178+ )
179+
180+ # Check that 'cleanup' was called correctly
181+ mock_clean .assert_called_once_with (
182+ call (
183+ dry_run = dry_run if dry_run else def_dry_run ,
184+ ),
185+ any_order = True ,
186+ )
0 commit comments