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

improve tests cleanup

This commit is contained in:
deadc0de6
2019-02-07 22:43:56 +01:00
parent bc1b23e1a2
commit 88c730157d
5 changed files with 7 additions and 3 deletions

View File

@@ -193,7 +193,7 @@ content=`cat ${tmpy}/a/somefile`
[ ! -e ${tmps}/dotfiles/def ] && exit 1
## CLEANING
rm -rf ${tmps} ${tmpd}
rm -rf ${tmps} ${tmpd} ${tmpx} ${tmpy}
echo "OK"
exit 0

View File

@@ -23,8 +23,9 @@ set -e
# execute tests with coverage
PYTHONPATH=dotdrop ${nosebin} -s --with-coverage --cover-package=dotdrop
#PYTHONPATH=dotdrop python3 -m pytest tests
# execute bash script tests
## execute bash script tests
for scr in tests-ng/*.sh; do
${scr}
done

View File

@@ -32,7 +32,8 @@ def clean(path):
def get_string(length):
"""Get a random string of length 'length'"""
alpha = string.ascii_uppercase + string.digits
return ''.join(random.choice(alpha) for _ in range(length))
temp = ''.join(random.choice(alpha) for _ in range(length))
return 'dotdrop-tests-{}'.format(temp)
def get_tempdir():

View File

@@ -150,6 +150,7 @@ exec bspwm
# to test actions
value = get_string(12)
fact = '/tmp/action'
self.addCleanup(clean, fact)
act1 = Action('testaction', 'post', 'echo "{}" > {}'.format(value,
fact))
f8, c8 = create_random_file(tmp)

View File

@@ -57,6 +57,7 @@ class TestUpdate(unittest.TestCase):
dpath = os.path.join(fold_config, get_string(5))
dir1 = create_dir(dpath)
dirf1, _ = create_random_file(dpath)
self.addCleanup(clean, dir1)
# create the config file
profile = get_string(5)