mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-05 12:38:50 +00:00
improve tests
This commit is contained in:
1
tests.sh
1
tests.sh
@@ -8,4 +8,5 @@ set -ev
|
||||
pep8 dotdrop/
|
||||
pep8 tests/
|
||||
PYTHONPATH=dotdrop nosetests --with-coverage --cover-package=dotdrop
|
||||
#PYTHONPATH=dotdrop nosetests -s --with-coverage --cover-package=dotdrop
|
||||
#PYTHONPATH=dotdrop python3 -m nose --with-coverage --cover-package=dotdrop
|
||||
|
||||
@@ -71,6 +71,7 @@ def load_config(confpath, profile):
|
||||
opts['safe'] = True
|
||||
opts['installdiff'] = True
|
||||
opts['link'] = False
|
||||
opts['quiet'] = True
|
||||
return conf, opts
|
||||
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ import yaml
|
||||
|
||||
from dotdrop.config import Cfg
|
||||
from dotdrop.dotdrop import importer
|
||||
from dotdrop.dotdrop import compare
|
||||
from dotdrop.dotfile import Dotfile
|
||||
from dotdrop.installer import Installer
|
||||
from dotdrop.templategen import Templategen
|
||||
@@ -133,6 +134,8 @@ class TestCompare(unittest.TestCase):
|
||||
results = self.compare(opts, conf, tmp, len(dfiles))
|
||||
self.assertTrue(results == expected)
|
||||
|
||||
compare(opts, conf, tmp)
|
||||
|
||||
|
||||
def main():
|
||||
unittest.main()
|
||||
|
||||
@@ -44,6 +44,7 @@ class TestConfig(unittest.TestCase):
|
||||
dotpath = os.path.join(tmp, self.CONFIG_DOTPATH)
|
||||
self.assertTrue(opts['dotpath'] == dotpath)
|
||||
self.assertTrue(conf._is_valid())
|
||||
self.assertTrue(conf.dump() != '')
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
@@ -74,6 +74,8 @@ exec bspwm
|
||||
f1, c1 = create_random_file(tmp)
|
||||
dst1 = os.path.join(dst, get_string(6))
|
||||
d1 = Dotfile(get_string(5), dst1, os.path.basename(f1))
|
||||
# fake a print
|
||||
self.assertTrue(str(d1) != '')
|
||||
f2, c2 = create_random_file(tmp)
|
||||
dst2 = os.path.join(dst, get_string(6))
|
||||
d2 = Dotfile(get_string(5), dst2, os.path.basename(f2))
|
||||
|
||||
Reference in New Issue
Block a user