mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-16 07:11:10 +00:00
improve tests
This commit is contained in:
1
tests.sh
1
tests.sh
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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()
|
||||||
|
|||||||
@@ -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():
|
||||||
|
|||||||
@@ -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))
|
||||||
|
|||||||
Reference in New Issue
Block a user