Move test for 'untag' from 'tag.t' to 'untag.t'

Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
This commit is contained in:
Thomas Lauf 2020-03-06 14:52:22 +01:00
parent 8e96ad5229
commit a72659f753
2 changed files with 13 additions and 10 deletions

12
test/tag.t Normal file → Executable file
View file

@ -207,12 +207,13 @@ class TestTag(TestCase):
description="unmodified interval")
def test_tag_with_identical_tags(self):
"""Call 'tag' with identical tags"""
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(len(j), 1)
self.assertEqual(j[0]['tags'], ['foo'])
def test_tag_with_identical_ids(self):
@ -280,15 +281,6 @@ 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

View file

@ -206,7 +206,18 @@ class TestUntag(TestCase):
expectedTags=["bar", "foo"],
description="unmodified interval")
def test_untag_with_identical_tags(self):
"""Call 'untag' with identical tags"""
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.assertEqual(len(j), 1)
self.assertEqual(j[0]['tags'], ['bar'])
def test_untag_with_identical_ids(self):
"""Call 'untag' with identical ids"""
now_utc = datetime.now().utcnow()
one_hour_before_utc = now_utc - timedelta(hours=1)