Skip to content

Commit c2ac907

Browse files
committed
Mocked out return value of the subprocesses
1 parent d3b33c2 commit c2ac907

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

tests/cli/test_build_images.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,18 @@ def test_run(
8080
# Assign it to the CLI to pass to the function
8181
sys.argv = build_cmd
8282

83-
# Mock 'build_image' return value
83+
# Mock the check for the existence of the Dockerfiles
84+
mock_exists.return_value = True
85+
86+
# Mock the exit code of the subprocesses being run
87+
mock_subprocess.return_value = 0
88+
89+
# Mock 'build_image' return values
8490
mock_build.side_effect = [
8591
f"{dst if dst else def_dst}/{image[0]}:{tags[0] if tags else def_tags[0]}"
8692
for image in images
8793
]
8894

89-
# Mock the check for the existence of the Dockerfiles
90-
mock_exists.return_value = True
91-
9295
# Run the function with the command
9396
run()
9497

0 commit comments

Comments
 (0)