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:
Thomas Lauf 2018-12-17 20:15:46 +01:00
parent c2c4691a23
commit 8e96ad5229
6 changed files with 44 additions and 11 deletions

18
test/tag.t Executable file → Normal file
View 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