mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
Tests: Added 'dom.tracked.N.tag.count' tests
This commit is contained in:
parent
f20f7b1c6e
commit
a43edf2c1b
1 changed files with 24 additions and 4 deletions
28
test/dom.t
28
test/dom.t
|
@ -165,20 +165,40 @@ class TestDOM(TestCase):
|
|||
code, out, err = self.t("get dom.active.json")
|
||||
self.assertRegexpMatches(out, r'{"start":"\d{8}T\d{6}Z","tags":\["foo"\]}')
|
||||
|
||||
|
||||
|
||||
def test_dom_tracked_count_none(self):
|
||||
"""Test dom.active without an active interval"""
|
||||
code, out, err = self.t("get dom.tracked.count")
|
||||
self.assertEqual('0\n', out)
|
||||
|
||||
|
||||
|
||||
|
||||
class TestDOMTracked(TestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
"""Executed before each test in the class"""
|
||||
cls.t = Timew()
|
||||
cls.t("track :yesterday one two") #2
|
||||
cls.t("start") #1
|
||||
|
||||
def setUp(self):
|
||||
"""Executed before each test in the class"""
|
||||
|
||||
def test_dom_tracked_count_some(self):
|
||||
"""Test dom.active with and with an active interval"""
|
||||
self.t("track 1am - 2am foo")
|
||||
self.t("track 2am - 3am bar")
|
||||
code, out, err = self.t("get dom.tracked.count")
|
||||
self.assertEqual('2\n', out)
|
||||
|
||||
def test_dom_tracked_N_tag_count_zero(self):
|
||||
"""Test dom.tracked.N.tag.count with zero tags"""
|
||||
code, out, err = self.t("get dom.tracked.1.tag.count")
|
||||
self.assertEqual('0\n', out)
|
||||
|
||||
def test_dom_tracked_N_tag_count_two(self):
|
||||
"""Test dom.tracked.N.tag.count with two tags"""
|
||||
code, out, err = self.t("get dom.tracked.2.tag.count")
|
||||
self.assertEqual('2\n', out)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
from simpletap import TAPTestRunner
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue