1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-16 09:26:11 +00:00

improve tests

This commit is contained in:
deadc0de6
2017-09-09 10:46:37 +02:00
parent a67d964f05
commit 9c4a846172
5 changed files with 8 additions and 0 deletions

View File

@@ -8,4 +8,5 @@ set -ev
pep8 dotdrop/ pep8 dotdrop/
pep8 tests/ pep8 tests/
PYTHONPATH=dotdrop nosetests --with-coverage --cover-package=dotdrop 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 #PYTHONPATH=dotdrop python3 -m nose --with-coverage --cover-package=dotdrop

View File

@@ -71,6 +71,7 @@ def load_config(confpath, profile):
opts['safe'] = True opts['safe'] = True
opts['installdiff'] = True opts['installdiff'] = True
opts['link'] = False opts['link'] = False
opts['quiet'] = True
return conf, opts return conf, opts

View File

@@ -11,6 +11,7 @@ import yaml
from dotdrop.config import Cfg from dotdrop.config import Cfg
from dotdrop.dotdrop import importer from dotdrop.dotdrop import importer
from dotdrop.dotdrop import compare
from dotdrop.dotfile import Dotfile from dotdrop.dotfile import Dotfile
from dotdrop.installer import Installer from dotdrop.installer import Installer
from dotdrop.templategen import Templategen from dotdrop.templategen import Templategen
@@ -133,6 +134,8 @@ class TestCompare(unittest.TestCase):
results = self.compare(opts, conf, tmp, len(dfiles)) results = self.compare(opts, conf, tmp, len(dfiles))
self.assertTrue(results == expected) self.assertTrue(results == expected)
compare(opts, conf, tmp)
def main(): def main():
unittest.main() unittest.main()

View File

@@ -44,6 +44,7 @@ class TestConfig(unittest.TestCase):
dotpath = os.path.join(tmp, self.CONFIG_DOTPATH) dotpath = os.path.join(tmp, self.CONFIG_DOTPATH)
self.assertTrue(opts['dotpath'] == dotpath) self.assertTrue(opts['dotpath'] == dotpath)
self.assertTrue(conf._is_valid()) self.assertTrue(conf._is_valid())
self.assertTrue(conf.dump() != '')
def main(): def main():

View File

@@ -74,6 +74,8 @@ exec bspwm
f1, c1 = create_random_file(tmp) f1, c1 = create_random_file(tmp)
dst1 = os.path.join(dst, get_string(6)) dst1 = os.path.join(dst, get_string(6))
d1 = Dotfile(get_string(5), dst1, os.path.basename(f1)) d1 = Dotfile(get_string(5), dst1, os.path.basename(f1))
# fake a print
self.assertTrue(str(d1) != '')
f2, c2 = create_random_file(tmp) f2, c2 = create_random_file(tmp)
dst2 = os.path.join(dst, get_string(6)) dst2 = os.path.join(dst, get_string(6))
d2 = Dotfile(get_string(5), dst2, os.path.basename(f2)) d2 = Dotfile(get_string(5), dst2, os.path.basename(f2))