Skip to content

Commit 07ef92e

Browse files
yuvipandaminrk
andauthored
Add extra_args test
Co-authored-by: Min RK <[email protected]>
1 parent 087c332 commit 07ef92e

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/unit/test_app.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,20 @@ def test_local_dir_image_name(repo_with_content):
7878
)
7979

8080

81+
def test_extra_buildx_build_args(repo_with_content):
82+
upstream, sha1 = repo_with_content
83+
argv = ['--DockerEngine.extra_buildx_build_args=--check', upstream]
84+
app = make_r2d(argv)
85+
with patch("repo2docker.docker.execute_cmd") as execute_cmd:
86+
app.build()
87+
88+
args, kwargs = execute_cmd.call_args
89+
cmd = args[0]
90+
assert cmd[:3] == ["docker", "buildx", "build"]
91+
# make sure it's inserted before the end
92+
assert "--check" in cmd[:-1]
93+
94+
8195
def test_run_kwargs(repo_with_content):
8296
upstream, sha1 = repo_with_content
8397
argv = [upstream]

0 commit comments

Comments
 (0)