diff --git a/docker/git-credential-env b/docker/git-credential-env index 905d9fee..21f1d505 100755 --- a/docker/git-credential-env +++ b/docker/git-credential-env @@ -1,2 +1,2 @@ #!/bin/bash -echo -e $GIT_CREDENTIAL_ENV +echo -e "$GIT_CREDENTIAL_ENV" diff --git a/tests/unit/test_docker.py b/tests/unit/test_docker.py new file mode 100644 index 00000000..88a5f327 --- /dev/null +++ b/tests/unit/test_docker.py @@ -0,0 +1,21 @@ +"""Tests for docker bits""" + +import os +from subprocess import check_output + +repo_root = os.path.abspath( + os.path.join(os.path.dirname(__file__), os.pardir, os.pardir) +) + + +def test_git_credential_env(): + credential_env = "username=abc\npassword=def" + out = ( + check_output( + os.path.join(repo_root, "docker", "git-credential-env"), + env={'GIT_CREDENTIAL_ENV': credential_env}, + ) + .decode() + .strip() + ) + assert out == credential_env