1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-04 21:29:43 +00:00

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.
This commit is contained in:
Joey Territo
2020-12-15 21:34:30 -05:00
parent 0b58578aa0
commit a73cfc2ef7

View File

@@ -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"