Skip to content

Commit db637c8

Browse files
committed
Mocked return values for the tag, push, and cleanup functions in the workflow
1 parent c2ac907 commit db637c8

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

tests/cli/test_build_images.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,25 @@ def test_run(
8787
mock_subprocess.return_value = 0
8888

8989
# Mock 'build_image' return values
90-
mock_build.side_effect = [
90+
image_paths = [
9191
f"{dst if dst else def_dst}/{image[0]}:{tags[0] if tags else def_tags[0]}"
9292
for image in images
9393
]
94+
mock_build.side_effect = image_paths
95+
96+
# Mock all the return values when tagging the images
97+
all_tags = [
98+
f"{image.split(':')[0]}:{tag}"
99+
for image in image_paths
100+
for tag in (tags if tags else def_tags)
101+
]
102+
mock_tag.side_effect = all_tags
103+
104+
# Mock the push function
105+
mock_push.return_value = True
106+
107+
# Mock the cleanup function
108+
mock_clean.return_value = True
94109

95110
# Run the function with the command
96111
run()

0 commit comments

Comments
 (0)