mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-06-26 10:54:28 +02:00
Move test for 'untag' from 'tag.t' to 'untag.t'
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
This commit is contained in:
parent
8e96ad5229
commit
a72659f753
2 changed files with 13 additions and 10 deletions
12
test/tag.t
Normal file → Executable file
12
test/tag.t
Normal file → Executable 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
|
||||
|
|
11
test/untag.t
11
test/untag.t
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue