From 8074e509ba095775f01943cdbe4f9fb048154900 Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Fri, 19 Nov 2021 23:13:49 -0500 Subject: [PATCH] tests: Add bulk removal test for tags attribute --- test/tag.t | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/test/tag.t b/test/tag.t index c70b12994..a00df163d 100755 --- a/test/tag.t +++ b/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