mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-11 07:54:15 +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
|
[ ! -e ${tmps}/dotfiles/def ] && exit 1
|
||||||
|
|
||||||
## CLEANING
|
## CLEANING
|
||||||
rm -rf ${tmps} ${tmpd}
|
rm -rf ${tmps} ${tmpd} ${tmpx} ${tmpy}
|
||||||
|
|
||||||
echo "OK"
|
echo "OK"
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
3
tests.sh
3
tests.sh
@@ -23,8 +23,9 @@ set -e
|
|||||||
|
|
||||||
# execute tests with coverage
|
# execute tests with coverage
|
||||||
PYTHONPATH=dotdrop ${nosebin} -s --with-coverage --cover-package=dotdrop
|
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
|
for scr in tests-ng/*.sh; do
|
||||||
${scr}
|
${scr}
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -32,7 +32,8 @@ def clean(path):
|
|||||||
def get_string(length):
|
def get_string(length):
|
||||||
"""Get a random string of length 'length'"""
|
"""Get a random string of length 'length'"""
|
||||||
alpha = string.ascii_uppercase + string.digits
|
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():
|
def get_tempdir():
|
||||||
|
|||||||
@@ -150,6 +150,7 @@ exec bspwm
|
|||||||
# to test actions
|
# to test actions
|
||||||
value = get_string(12)
|
value = get_string(12)
|
||||||
fact = '/tmp/action'
|
fact = '/tmp/action'
|
||||||
|
self.addCleanup(clean, fact)
|
||||||
act1 = Action('testaction', 'post', 'echo "{}" > {}'.format(value,
|
act1 = Action('testaction', 'post', 'echo "{}" > {}'.format(value,
|
||||||
fact))
|
fact))
|
||||||
f8, c8 = create_random_file(tmp)
|
f8, c8 = create_random_file(tmp)
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ class TestUpdate(unittest.TestCase):
|
|||||||
dpath = os.path.join(fold_config, get_string(5))
|
dpath = os.path.join(fold_config, get_string(5))
|
||||||
dir1 = create_dir(dpath)
|
dir1 = create_dir(dpath)
|
||||||
dirf1, _ = create_random_file(dpath)
|
dirf1, _ = create_random_file(dpath)
|
||||||
|
self.addCleanup(clean, dir1)
|
||||||
|
|
||||||
# create the config file
|
# create the config file
|
||||||
profile = get_string(5)
|
profile = get_string(5)
|
||||||
|
|||||||
Reference in New Issue
Block a user