mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
Tests: Added dom.active.duration tests
This commit is contained in:
parent
e654a51c5a
commit
3fd2020ab0
1 changed files with 11 additions and 0 deletions
11
test/dom.t
11
test/dom.t
|
@ -117,6 +117,17 @@ class TestDOM(TestCase):
|
|||
code, out, err = self.t("get dom.active.start")
|
||||
self.assertRegexpMatches(out, r'\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}')
|
||||
|
||||
def test_dom_active_duration_inactive(self):
|
||||
"""Test dom.active.duration with no active track"""
|
||||
code, out, err = self.t.runError("get dom.active.duration")
|
||||
self.assertIn("DOM reference 'dom.active.duration' is not valid.", err)
|
||||
|
||||
def test_dom_active_duration_active(self):
|
||||
"""Test dom.active.duration with active track"""
|
||||
self.t("start one two")
|
||||
code, out, err = self.t("get dom.active.duration")
|
||||
self.assertRegexpMatches(out, r'PT\d+S')
|
||||
|
||||
if __name__ == "__main__":
|
||||
from simpletap import TAPTestRunner
|
||||
unittest.main(testRunner=TAPTestRunner())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue