mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
Add test for get dom.tracked.tags
with a tag with quotes
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
This commit is contained in:
parent
dafca6662d
commit
532d1b4e91
1 changed files with 14 additions and 0 deletions
14
test/dom.t
14
test/dom.t
|
@ -197,6 +197,20 @@ class TestDOMTracked(TestCase):
|
|||
code, out, err = self.t("get dom.tracked.tags")
|
||||
self.assertEqual("bar foo\n", out)
|
||||
|
||||
def test_dom_tracked_tags_with_quoted_tag(self):
|
||||
"""Test dom.tracked.tags with a tag with quotes"""
|
||||
now_utc = datetime.now().utcnow()
|
||||
two_hours_before_utc = now_utc - timedelta(hours=2)
|
||||
three_hours_before_utc = now_utc - timedelta(hours=3)
|
||||
four_hours_before_utc = now_utc - timedelta(hours=4)
|
||||
five_hours_before_utc = now_utc - timedelta(hours=5)
|
||||
|
||||
self.t("track {:%Y-%m-%dT%H:%M:%S}Z - {:%Y-%m-%dT%H:%M:%S}Z \"with quotes\"".format(five_hours_before_utc, four_hours_before_utc))
|
||||
self.t("track {:%Y-%m-%dT%H:%M:%S}Z - {:%Y-%m-%dT%H:%M:%S}Z bar".format(three_hours_before_utc, two_hours_before_utc))
|
||||
|
||||
code, out, err = self.t("get dom.tracked.tags")
|
||||
self.assertEqual("bar \"with quotes\"\n", out)
|
||||
|
||||
def test_dom_tracked_tags_filtered_by_time(self):
|
||||
"""Test dom.tracked.tags with tags filtered by time"""
|
||||
now_utc = datetime.now().utcnow()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue