From a73cfc2ef7ded9aa3477b38620215528cd3f1f74 Mon Sep 17 00:00:00 2001 From: Joey Territo Date: Tue, 15 Dec 2020 21:34:30 -0500 Subject: [PATCH] Fix unit test for negative ignore patterns in install command On macOS, creating a temporary directory creates a hard link to a file with a different name, which causes dotdrop to think it is importing a symlink. This causes the unit tests to fail as dotdrop attempts to ask the user if it should dereference the symlink, but dotdrop is not connected to stdin when the shell script tests are running so dotdrop crashes with an EOFError. The solution is to pass the -f flag when invoking `dotdrop import` in tests. --- tests-ng/install-negative-ignore.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests-ng/install-negative-ignore.sh b/tests-ng/install-negative-ignore.sh index f6b7fa2..4eacef0 100755 --- a/tests-ng/install-negative-ignore.sh +++ b/tests-ng/install-negative-ignore.sh @@ -6,7 +6,7 @@ # # exit on first error -#set -e +set -e # all this crap to get current path if [ $(uname) = Darwin ]; then @@ -55,6 +55,7 @@ ddpath="${cur}/../" export PYTHONPATH="${ddpath}:${PYTHONPATH}" bin="python3 -m dotdrop.dotdrop" +hash coverage 2>/dev/null && bin="converage run -a --source=dotdrop -m dotdrop.dotdrop" || true echo "dotdrop path: ${ddpath}" echo "pythonpath: ${PYTHONPATH}" @@ -88,7 +89,7 @@ create_conf ${cfg} # sets token # import echo "[+] import" -cd ${ddpath} | ${bin} import -c ${cfg} ${tmpd}/program +cd ${ddpath} | ${bin} import -f -c ${cfg} ${tmpd}/program # adding ignore in dotfile cfg2="${basedir}/config2.yaml"