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:
@@ -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
|
||||
|
||||
3
tests.sh
3
tests.sh
@@ -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
|
||||
|
||||
@@ -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():
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user