mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-06 04:23:01 +00:00
disable debug in tests with env var
This commit is contained in:
@@ -10,7 +10,7 @@ import string
|
||||
import random
|
||||
import tempfile
|
||||
|
||||
from dotdrop.options import Options
|
||||
from dotdrop.options import Options, ENV_NODEBUG
|
||||
from dotdrop.linktypes import LinkTypes
|
||||
from dotdrop.utils import strip_home
|
||||
|
||||
@@ -128,6 +128,8 @@ def load_options(confpath, profile):
|
||||
o.link = LinkTypes.NOLINK.value
|
||||
o.install_showdiff = True
|
||||
o.debug = True
|
||||
if ENV_NODEBUG in os.environ:
|
||||
o.debug = False
|
||||
o.compare_dopts = ''
|
||||
o.variables = {}
|
||||
return o
|
||||
|
||||
@@ -29,9 +29,9 @@ class TestCompare(unittest.TestCase):
|
||||
def compare(self, o, tmp, nbdotfiles):
|
||||
dotfiles = o.dotfiles
|
||||
self.assertTrue(len(dotfiles) == nbdotfiles)
|
||||
t = Templategen(base=o.dotpath, debug=True)
|
||||
t = Templategen(base=o.dotpath, debug=o.debug)
|
||||
inst = Installer(create=o.create, backup=o.backup,
|
||||
dry=o.dry, base=o.dotpath, debug=True)
|
||||
dry=o.dry, base=o.dotpath, debug=o.debug)
|
||||
comp = Comparator()
|
||||
results = {}
|
||||
for dotfile in dotfiles:
|
||||
|
||||
@@ -186,7 +186,6 @@ exec bspwm
|
||||
# install them
|
||||
o = load_options(confpath, profile)
|
||||
o.safe = False
|
||||
o.debug = True
|
||||
o.install_showdiff = True
|
||||
o.variables = {}
|
||||
cmd_install(o)
|
||||
|
||||
@@ -94,7 +94,6 @@ class TestUpdate(unittest.TestCase):
|
||||
create=self.CONFIG_CREATE)
|
||||
self.assertTrue(os.path.exists(confpath))
|
||||
o = load_options(confpath, profile)
|
||||
o.debug = True
|
||||
o.update_showpatch = True
|
||||
dfiles = [d1, dir1, d2, d3t, dsubstmp]
|
||||
|
||||
@@ -105,7 +104,6 @@ class TestUpdate(unittest.TestCase):
|
||||
# get new config
|
||||
o = load_options(confpath, profile)
|
||||
o.safe = False
|
||||
o.debug = True
|
||||
o.update_showpatch = True
|
||||
trans = Transform('trans', 'cp -r {0} {1}')
|
||||
d3tb = os.path.basename(d3t)
|
||||
|
||||
Reference in New Issue
Block a user