mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-19 00:43:07 +02:00
tests: Add bulk removal test for tags attribute
This commit is contained in:
parent
af10774aec
commit
8074e509ba
1 changed files with 14 additions and 4 deletions
18
test/tag.t
18
test/tag.t
|
@ -36,13 +36,10 @@ from basetest import Task, TestCase
|
|||
|
||||
|
||||
class TestTags(TestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
"""Executed once before any test in the class"""
|
||||
cls.t = Task()
|
||||
|
||||
def setUp(self):
|
||||
"""Executed before each test in the class"""
|
||||
self.t = Task()
|
||||
|
||||
def split_tags(self, tags):
|
||||
return sorted(tags.strip().split(','))
|
||||
|
@ -81,6 +78,19 @@ class TestTags(TestCase):
|
|||
code, out, err = self.t("1 modify -missing")
|
||||
self.assertIn("Modified 0 tasks", out)
|
||||
|
||||
def test_tag_bulk_removal(self):
|
||||
"""2655: Test bulk removal of tags"""
|
||||
self.t("add +one This +two is a test +three")
|
||||
code, out, err = self.t("_get 1.tags")
|
||||
self.assertEqual(
|
||||
sorted(["one", "two", "three"]),
|
||||
self.split_tags(out))
|
||||
|
||||
# Remove all tags in bulk
|
||||
self.t("1 modify tags:")
|
||||
code, out, err = self.t("_get 1.tags")
|
||||
self.assertEqual("\n", out)
|
||||
|
||||
|
||||
class TestVirtualTags(TestCase):
|
||||
@classmethod
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue