mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-06-26 10:54:28 +02:00
Add functions to add/remove a set of tags to/from an interval
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
This commit is contained in:
parent
c2c4691a23
commit
8e96ad5229
6 changed files with 44 additions and 11 deletions
18
test/tag.t
Executable file → Normal file
18
test/tag.t
Executable file → Normal file
|
@ -206,6 +206,15 @@ class TestTag(TestCase):
|
|||
expectedTags=["foo"],
|
||||
description="unmodified interval")
|
||||
|
||||
def test_tag_with_identical_tags(self):
|
||||
self.t("track 2016-01-01T00:00:00 - 2016-01-01T01:00:00")
|
||||
self.t("tag @1 foo foo")
|
||||
|
||||
j = self.t.export()
|
||||
|
||||
self.assertEquals(len(j), 1)
|
||||
self.assertEqual(j[0]['tags'], ['foo'])
|
||||
|
||||
def test_tag_with_identical_ids(self):
|
||||
"""Call 'tag' with identical ids"""
|
||||
now_utc = datetime.now().utcnow()
|
||||
|
@ -271,6 +280,15 @@ class TestTag(TestCase):
|
|||
code, out, err = self.t.runError("tag @2 foo")
|
||||
self.assertIn("ID '@2' does not correspond to any tracking.", err)
|
||||
|
||||
def test_untag_with_identical_tags(self):
|
||||
self.t("track 2016-01-01T00:00:00 - 2016-01-01T01:00:00 foo bar")
|
||||
self.t("untag @1 foo foo")
|
||||
|
||||
j = self.t.export()
|
||||
|
||||
self.assertEquals(len(j), 1)
|
||||
self.assertEqual(j[0]['tags'], ['bar'])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
from simpletap import TAPTestRunner
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue