Tests: Fix python doc strings

This commit is contained in:
Thomas Lauf 2017-03-25 15:36:16 +01:00
parent e6718067b6
commit e9412388ba
2 changed files with 8 additions and 13 deletions

View file

@ -60,12 +60,11 @@ class Timew(object):
return "{0} running from {1}>".format(txt[:-1], self.datadir)
def __call__(self, *args, **kwargs):
"aka t = Timew() ; t() which is now an alias to t.runSuccess()"
"""aka t = Timew() ; t() which is now an alias to t.runSuccess()"""
return self.runSuccess(*args, **kwargs)
def reset_env(self):
"""Set a new environment derived from the one used to launch the test
"""
"""Set a new environment derived from the one used to launch the test"""
# Copy all env variables to avoid clashing subprocess environments
self.env = os.environ.copy()
@ -73,8 +72,7 @@ class Timew(object):
self.env["TIMEWARRIORDB"] = self.datadir
def config(self, var, value):
"""Run setup `var` as `value` in timew config
"""
"""Run setup `var` as `value` in timew config"""
# Add -- to avoid misinterpretation of - in things like UUIDs
# TODO Revisit this decision as timew matures.
#cmd = (self.timew, "config", "--", var, value)
@ -82,16 +80,13 @@ class Timew(object):
return run_cmd_wait(cmd, env=self.env, input="y\n")
def del_config(self, var):
"""Remove `var` from timew config
"""
"""Remove `var` from timew config"""
cmd = (self.timew, ":yes", "config", var)
return run_cmd_wait(cmd, env=self.env, input="y\n")
@property
def timewrc_content(self):
"""
Returns the contents of the timewrc file.
"""
"""Returns the contents of the timewrc file."""
with open(self.timewrc, "r") as f:
return f.readlines()

View file

@ -89,7 +89,7 @@ class TestDOM(TestCase):
self.assertEqual('0\n', out)
def test_dom_active_active(self):
"""Test dom.active with and with an active interval"""
"""Test dom.active with an active interval"""
self.t("start foo")
code, out, err = self.t("get dom.active")
self.assertEqual('1\n', out)
@ -156,7 +156,7 @@ class TestDOM(TestCase):
self.assertIn("DOM reference 'dom.active.json' is not valid.", err)
def test_dom_active_json_active(self):
"""Test dom.active.json with and with an active interval"""
"""Test dom.active.json with an active interval"""
self.t("start foo")
code, out, err = self.t("get dom.active.json")
self.assertRegexpMatches(out, r'{"start":"\d{8}T\d{6}Z","tags":\["foo"\]}')
@ -178,7 +178,7 @@ class TestDOMTracked(TestCase):
"""Executed before each test in the class"""
def test_dom_tracked_count_some(self):
"""Test dom.active with and with an active interval"""
"""Test dom.tracked.count with an active interval"""
code, out, err = self.t("get dom.tracked.count")
self.assertEqual('2\n', out)