1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-05 13:48:48 +00:00

update tests

This commit is contained in:
deadc0de6
2019-02-07 22:11:27 +01:00
parent f9be717ff3
commit f5b9b15326
27 changed files with 69 additions and 69 deletions

View File

@@ -46,12 +46,12 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m"
################################################################
# the action temp
tmpa=`mktemp -d`
tmpa=`mktemp -d --suffix='-dotdrop-tests'`
# the dotfile source
tmps=`mktemp -d`
tmps=`mktemp -d --suffix='-dotdrop-tests'`
mkdir -p ${tmps}/dotfiles
# the dotfile destination
tmpd=`mktemp -d`
tmpd=`mktemp -d --suffix='-dotdrop-tests'`
# create the config file
cfg="${tmps}/config.yaml"

View File

@@ -46,12 +46,12 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m"
################################################################
# the action temp
tmpa=`mktemp -d`
tmpa=`mktemp -d --suffix='-dotdrop-tests'`
# the dotfile source
tmps=`mktemp -d`
tmps=`mktemp -d --suffix='-dotdrop-tests'`
mkdir -p ${tmps}/dotfiles
# the dotfile destination
tmpd=`mktemp -d`
tmpd=`mktemp -d --suffix='-dotdrop-tests'`
# create the config file
cfg="${tmps}/config.yaml"

View File

@@ -46,12 +46,12 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m"
################################################################
# the action temp
tmpa=`mktemp -d`
tmpa=`mktemp -d --suffix='-dotdrop-tests'`
# the dotfile source
tmps=`mktemp -d`
tmps=`mktemp -d --suffix='-dotdrop-tests'`
mkdir -p ${tmps}/dotfiles
# the dotfile destination
tmpd=`mktemp -d`
tmpd=`mktemp -d --suffix='-dotdrop-tests'`
# create the config file
cfg="${tmps}/config.yaml"

View File

@@ -46,12 +46,12 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m"
################################################################
# dotdrop directory
basedir=`mktemp -d`
basedir=`mktemp -d --suffix='-dotdrop-tests'`
echo "[+] dotdrop dir: ${basedir}"
echo "[+] dotpath dir: ${basedir}/dotfiles"
# the dotfile to be imported
tmpd=`mktemp -d`
tmpd=`mktemp -d --suffix='-dotdrop-tests'`
# some files
mkdir -p ${tmpd}/{program,config}

View File

@@ -46,12 +46,12 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m"
################################################################
# dotdrop directory
basedir=`mktemp -d`
basedir=`mktemp -d --suffix='-dotdrop-tests'`
echo "[+] dotdrop dir: ${basedir}"
echo "[+] dotpath dir: ${basedir}/dotfiles"
# the dotfile to be imported
tmpd=`mktemp -d`
tmpd=`mktemp -d --suffix='-dotdrop-tests'`
# single file
echo 'unique' > ${tmpd}/uniquefile

View File

@@ -46,11 +46,11 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m"
################################################################
# dotdrop directory
basedir=`mktemp -d`
basedir=`mktemp -d --suffix='-dotdrop-tests'`
dotfiles="${basedir}/dotfiles"
echo "dotdrop dir: ${basedir}"
# the dotfile
tmpd=`mktemp -d`
tmpd=`mktemp -d --suffix='-dotdrop-tests'`
create_dir ${tmpd}
# create the config file

View File

@@ -46,10 +46,10 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m"
################################################################
# the dotfile source
tmps=`mktemp -d`
tmps=`mktemp -d --suffix='-dotdrop-tests'`
mkdir -p ${tmps}/dotfiles
# the dotfile destination
tmpd=`mktemp -d`
tmpd=`mktemp -d --suffix='-dotdrop-tests'`
# create the config file
cfg="${tmps}/config.yaml"

View File

@@ -46,12 +46,12 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m"
################################################################
# the action temp
tmpa=`mktemp -d`
tmpa=`mktemp -d --suffix='-dotdrop-tests'`
# the dotfile source
tmps=`mktemp -d`
tmps=`mktemp -d --suffix='-dotdrop-tests'`
mkdir -p ${tmps}/dotfiles
# the dotfile destination
tmpd=`mktemp -d`
tmpd=`mktemp -d --suffix='-dotdrop-tests'`
# create the config file
cfg="${tmps}/config.yaml"

View File

@@ -46,10 +46,10 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m"
################################################################
# the dotfile source
tmps=`mktemp -d`
tmps=`mktemp -d --suffix='-dotdrop-tests'`
mkdir -p ${tmps}/dotfiles
# the dotfile destination
tmpd=`mktemp -d`
tmpd=`mktemp -d --suffix='-dotdrop-tests'`
# create the config file
cfg="${tmps}/config.yaml"

View File

@@ -46,15 +46,15 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m"
################################################################
# the dotfile source
tmps=`mktemp -d`
tmps=`mktemp -d --suffix='-dotdrop-tests'`
mkdir -p ${tmps}/dotfiles
# the dotfile destination
tmpd=`mktemp -d`
tmpd=`mktemp -d --suffix='-dotdrop-tests'`
#echo "dotfile destination: ${tmpd}"
# create a shell script
export TESTENV="this is my testenv"
scr=`mktemp`
scr=`mktemp --suffix='-dotdrop-tests'`
chmod +x ${scr}
echo -e "#!/bin/bash\necho $TESTENV\n" >> ${scr}

View File

@@ -46,11 +46,11 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m"
################################################################
# the dotfile source
tmps=`mktemp -d`
tmps=`mktemp -d --suffix='-dotdrop-tests'`
mkdir -p ${tmps}/dotfiles
#echo "dotfile source: ${tmps}"
# the dotfile destination
tmpd=`mktemp -d`
tmpd=`mktemp -d --suffix='-dotdrop-tests'`
#echo "dotfile destination: ${tmpd}"
# create the config file

View File

@@ -46,11 +46,11 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m"
################################################################
# the dotfile source
tmps=`mktemp -d`
tmps=`mktemp -d --suffix='-dotdrop-tests'`
mkdir -p ${tmps}/dotfiles
#echo "dotfile source: ${tmps}"
# the dotfile destination
tmpd=`mktemp -d`
tmpd=`mktemp -d --suffix='-dotdrop-tests'`
#echo "dotfile destination: ${tmpd}"
# create the config file

View File

@@ -46,10 +46,10 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m"
################################################################
# the dotfile source
tmps=`mktemp -d`
tmps=`mktemp -d --suffix='-dotdrop-tests'`
mkdir -p ${tmps}/dotfiles
# the dotfile destination
tmpd=`mktemp -d`
tmpd=`mktemp -d --suffix='-dotdrop-tests'`
# create the config file
cfg="${tmps}/config.yaml"

View File

@@ -46,10 +46,10 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m"
################################################################
# the dotfile source
tmps=`mktemp -d`
tmps=`mktemp -d --suffix='-dotdrop-tests'`
mkdir -p ${tmps}/dotfiles
# the dotfile destination
tmpd=`mktemp -d`
tmpd=`mktemp -d --suffix='-dotdrop-tests'`
#echo "dotfile destination: ${tmpd}"
# create the config file

View File

@@ -46,7 +46,7 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m"
################################################################
# the dotfile source
tmps=`mktemp -d`
tmps=`mktemp -d --suffix='-dotdrop-tests'`
mkdir -p ${tmps}/dotfiles
echo "dotfiles source (dotpath): ${tmps}"
# the dotfile destination

View File

@@ -46,14 +46,14 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m"
################################################################
# the dotfile source
tmps=`mktemp -d`
tmps=`mktemp -d --suffix='-dotdrop-tests'`
mkdir -p ${tmps}/dotfiles
echo "dotfiles source (dotpath): ${tmps}"
# the dotfile destination
tmpd=`mktemp -d`
tmpd=`mktemp -d --suffix='-dotdrop-tests'`
echo "dotfiles destination: ${tmpd}"
# the workdir
tmpw=`mktemp -d`
tmpw=`mktemp -d --suffix='-dotdrop-tests'`
echo "workdir: ${tmpw}"

View File

@@ -46,14 +46,14 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m"
################################################################
# the dotfile source
tmps=`mktemp -d`
tmps=`mktemp -d --suffix='-dotdrop-tests'`
mkdir -p ${tmps}/dotfiles
echo "dotfiles source (dotpath): ${tmps}"
# the dotfile destination
tmpd=`mktemp -d`
tmpd=`mktemp -d --suffix='-dotdrop-tests'`
echo "dotfiles destination: ${tmpd}"
# the workdir
tmpw=`mktemp -d`
tmpw=`mktemp -d --suffix='-dotdrop-tests'`
echo "workdir: ${tmpw}"

View File

@@ -46,20 +46,20 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m"
################################################################
# the dotfile source
tmps=`mktemp -d`
tmps=`mktemp -d --suffix='-dotdrop-tests'`
mkdir -p ${tmps}/dotfiles
# the dotfile destination
tmpd=`mktemp -d`
tmpd=`mktemp -d --suffix='-dotdrop-tests'`
#echo "dotfile destination: ${tmpd}"
# create a shell script
export TESTENV="this is my global testenv"
scr=`mktemp`
scr=`mktemp --suffix='-dotdrop-tests'`
chmod +x ${scr}
echo -e "#!/bin/bash\necho $TESTENV\n" >> ${scr}
export TESTENV2="this is my profile testenv"
scr2=`mktemp`
scr2=`mktemp --suffix='-dotdrop-tests'`
chmod +x ${scr2}
echo -e "#!/bin/bash\necho $TESTENV2\n" >> ${scr2}

View File

@@ -46,10 +46,10 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m"
################################################################
# the dotfile source
tmps=`mktemp -d`
tmps=`mktemp -d --suffix='-dotdrop-tests'`
mkdir -p ${tmps}/dotfiles
# the dotfile destination
tmpd=`mktemp -d`
tmpd=`mktemp -d --suffix='-dotdrop-tests'`
#echo "dotfile destination: ${tmpd}"
# create the config file

View File

@@ -48,11 +48,11 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m"
################################################################
# the dotfile source
tmps=`mktemp -d`
tmps=`mktemp -d --suffix='-dotdrop-tests'`
mkdir -p ${tmps}/dotfiles
echo "dotfiles source (dotpath): ${tmps}"
# the dotfile destination
tmpd=`mktemp -d`
tmpd=`mktemp -d --suffix='-dotdrop-tests'`
echo "dotfiles destination: ${tmpd}"
# create the config file
@@ -98,7 +98,7 @@ _EOF
cat ${cfg}
# create the base64 dotfile
tmpf=`mktemp`
tmpf=`mktemp --suffix='-dotdrop-tests'`
echo ${token} > ${tmpf}
cat ${tmpf} | base64 > ${tmps}/dotfiles/abc
rm -f ${tmpf}
@@ -107,7 +107,7 @@ rm -f ${tmpf}
echo 'marker' > ${tmps}/dotfiles/def
# create the compressed dotfile
tmpx=`mktemp -d`
tmpx=`mktemp -d --suffix='-dotdrop-tests'`
mkdir -p ${tmpx}/{a,b,c}
mkdir -p ${tmpx}/a/{dir1,dir2}
# ambiguous redirect ??
@@ -184,7 +184,7 @@ cd ${ddpath} | ${bin} update -f -k -c ${cfg} -p p1 -b -V d_ghi
tar -tf ${tmps}/dotfiles/ghi | grep './b/newfile'
tar -tf ${tmps}/dotfiles/ghi | grep './a/dir1/otherfile'
tmpy=`mktemp -d`
tmpy=`mktemp -d --suffix='-dotdrop-tests'`
tar -xf ${tmps}/dotfiles/ghi -C ${tmpy}
content=`cat ${tmpy}/a/somefile`
[ "${content}" != "${touched}" ] && exit 1

View File

@@ -46,7 +46,7 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m"
################################################################
# dotdrop directory
tmps=`mktemp -d`
tmps=`mktemp -d --suffix='-dotdrop-tests'`
dt="${tmps}/dotfiles"
mkdir -p ${dt}
mkdir -p ${dt}/a/{b,c}
@@ -54,7 +54,7 @@ echo 'a' > ${dt}/a/b/abfile
echo 'a' > ${dt}/a/c/acfile
# fs dotfiles
tmpd=`mktemp -d`
tmpd=`mktemp -d --suffix='-dotdrop-tests'`
cp -r ${dt}/a ${tmpd}/
# create the config file

View File

@@ -46,14 +46,14 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m"
################################################################
# the dotfile source
tmps=`mktemp -d`
tmps=`mktemp -d --suffix='-dotdrop-tests'`
mkdir -p ${tmps}/dotfiles
echo "dotfiles source (dotpath): ${tmps}"
# the dotfile destination
tmpd=`mktemp -d`
tmpd=`mktemp -d --suffix='-dotdrop-tests'`
echo "dotfiles destination: ${tmpd}"
# the workdir
tmpw=`mktemp -d`
tmpw=`mktemp -d --suffix='-dotdrop-tests'`
echo "workdir: ${tmpw}"

View File

@@ -46,12 +46,12 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m"
################################################################
# dotdrop directory
basedir=`mktemp -d`
basedir=`mktemp -d --suffix='-dotdrop-tests'`
echo "[+] dotdrop dir: ${basedir}"
echo "[+] dotpath dir: ${basedir}/dotfiles"
# the dotfile to be imported
tmpd=`mktemp -d`
tmpd=`mktemp -d --suffix='-dotdrop-tests'`
# originally imported directory
echo 'unique' > ${tmpd}/uniquefile

View File

@@ -46,12 +46,12 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m"
################################################################
# dotdrop directory
basedir=`mktemp -d`
basedir=`mktemp -d --suffix='-dotdrop-tests'`
echo "[+] dotdrop dir: ${basedir}"
echo "[+] dotpath dir: ${basedir}/dotfiles"
# the dotfile to be imported
tmpd=`mktemp -d`
tmpd=`mktemp -d --suffix='-dotdrop-tests'`
# single file
echo 'unique' > ${tmpd}/uniquefile

View File

@@ -46,11 +46,11 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m"
################################################################
# the dotfile source
tmps=`mktemp -d`
tmps=`mktemp -d --suffix='-dotdrop-tests'`
mkdir -p ${tmps}/dotfiles
#echo "dotfile source: ${tmps}"
# the dotfile destination
tmpd=`mktemp -d`
tmpd=`mktemp -d --suffix='-dotdrop-tests'`
#echo "dotfile destination: ${tmpd}"
# create the config file

View File

@@ -47,7 +47,7 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m"
string="blabla"
# the dotfile source
tmp=`mktemp -d`
tmp=`mktemp -d --suffix='-dotdrop-tests'`
tmpf="${tmp}/dotfiles"
tmpw="${tmp}/workdir"
@@ -62,7 +62,7 @@ cfg="${tmp}/config.yaml"
echo "config file: ${cfg}"
# the dotfile destination
tmpd=`mktemp -d`
tmpd=`mktemp -d --suffix='-dotdrop-tests'`
echo "dotfiles destination: ${tmpd}"
## RELATIVE
@@ -104,7 +104,7 @@ rm -rf ${tmp} ${tmpd}
## ABSOLUTE
echo "RUNNING ABSOLUTE"
# the dotfile source
tmp=`mktemp -d`
tmp=`mktemp -d --suffix='-dotdrop-tests'`
tmpf="${tmp}/dotfiles"
tmpw="${tmp}/workdir"
@@ -119,7 +119,7 @@ cfg="${tmp}/config.yaml"
echo "config file: ${cfg}"
# the dotfile destination
tmpd=`mktemp -d`
tmpd=`mktemp -d --suffix='-dotdrop-tests'`
echo "dotfiles destination: ${tmpd}"
cat > ${cfg} << _EOF
@@ -159,7 +159,7 @@ rm -rf ${tmp} ${tmpd}
## NONE
echo "RUNNING UNDEFINED WORKDIR"
# the dotfile source
tmp=`mktemp -d`
tmp=`mktemp -d --suffix='-dotdrop-tests'`
tmpf="${tmp}/dotfiles"
@@ -171,7 +171,7 @@ cfg="${tmp}/config.yaml"
echo "config file: ${cfg}"
# the dotfile destination
tmpd=`mktemp -d`
tmpd=`mktemp -d --suffix='-dotdrop-tests'`
echo "dotfiles destination: ${tmpd}"
cat > ${cfg} << _EOF

View File

@@ -37,7 +37,7 @@ def get_string(length):
def get_tempdir():
"""Get a temporary directory"""
return tempfile.mkdtemp(suffix=TMPSUFFIX)
return tempfile.mkdtemp(prefix='dotdrop-tests-')
def create_random_file(directory, content=None,