mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-19 19:03:07 +02:00
Test: Updated task arg call
This commit is contained in:
parent
5a21945a0d
commit
6c56f4b695
1 changed files with 45 additions and 45 deletions
|
@ -40,16 +40,16 @@ class TestOperatorsIdentity(TestCase):
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
cls.t = Task()
|
cls.t = Task()
|
||||||
|
|
||||||
cls.t(("add", "one", "project:A", "priority:H"))
|
cls.t("add one project:A priority:H")
|
||||||
cls.t(("add", "two", "project:A"))
|
cls.t("add two project:A")
|
||||||
cls.t(("add", "three", "priority:H"))
|
cls.t("add three priority:H")
|
||||||
cls.t(("add", "four"))
|
cls.t("add four")
|
||||||
|
|
||||||
# AND operator #
|
# AND operator #
|
||||||
|
|
||||||
def test_implicit_and(self):
|
def test_implicit_and(self):
|
||||||
"""operator implicit and :"""
|
"""operator implicit and :"""
|
||||||
code, out, err = self.t(("ls", "project:A", "priority:H"))
|
code, out, err = self.t("ls project:A priority:H")
|
||||||
|
|
||||||
self.assertIn("one", out)
|
self.assertIn("one", out)
|
||||||
self.assertNotIn("two", out)
|
self.assertNotIn("two", out)
|
||||||
|
@ -58,7 +58,7 @@ class TestOperatorsIdentity(TestCase):
|
||||||
|
|
||||||
def test_explicit_and(self):
|
def test_explicit_and(self):
|
||||||
"""operator explicit and :"""
|
"""operator explicit and :"""
|
||||||
code, out, err = self.t(("ls", "project:A", "and", "priority:H"))
|
code, out, err = self.t("ls project:A and priority:H")
|
||||||
|
|
||||||
self.assertIn("one", out)
|
self.assertIn("one", out)
|
||||||
self.assertNotIn("two", out)
|
self.assertNotIn("two", out)
|
||||||
|
@ -67,7 +67,7 @@ class TestOperatorsIdentity(TestCase):
|
||||||
|
|
||||||
def test_and_not(self):
|
def test_and_not(self):
|
||||||
"""operator and + not :"""
|
"""operator and + not :"""
|
||||||
code, out, err = self.t(("ls", "project:A", "and", "priority.not:H"))
|
code, out, err = self.t("ls project:A and priority.not:H")
|
||||||
|
|
||||||
self.assertNotIn("one", out)
|
self.assertNotIn("one", out)
|
||||||
self.assertIn("two", out)
|
self.assertIn("two", out)
|
||||||
|
@ -76,7 +76,7 @@ class TestOperatorsIdentity(TestCase):
|
||||||
|
|
||||||
def test_implicit_and_equal(self):
|
def test_implicit_and_equal(self):
|
||||||
"""operator implicit and ="""
|
"""operator implicit and ="""
|
||||||
code, out, err = self.t(("ls", "project:A", "priority:H"))
|
code, out, err = self.t("ls project:A priority:H")
|
||||||
|
|
||||||
self.assertIn("one", out)
|
self.assertIn("one", out)
|
||||||
self.assertNotIn("two", out)
|
self.assertNotIn("two", out)
|
||||||
|
@ -85,7 +85,7 @@ class TestOperatorsIdentity(TestCase):
|
||||||
|
|
||||||
def test_explicit_and_equal(self):
|
def test_explicit_and_equal(self):
|
||||||
"""operator explicit and ="""
|
"""operator explicit and ="""
|
||||||
code, out, err = self.t(("ls", "project:A", "and", "priority:H"))
|
code, out, err = self.t("ls project:A and priority:H")
|
||||||
|
|
||||||
self.assertIn("one", out)
|
self.assertIn("one", out)
|
||||||
self.assertNotIn("two", out)
|
self.assertNotIn("two", out)
|
||||||
|
@ -94,7 +94,7 @@ class TestOperatorsIdentity(TestCase):
|
||||||
|
|
||||||
def test_and_not_equal(self):
|
def test_and_not_equal(self):
|
||||||
"""operator and + not ="""
|
"""operator and + not ="""
|
||||||
code, out, err = self.t(("ls", "project:A", "and", "priority.not:H"))
|
code, out, err = self.t("ls project:A and priority.not:H")
|
||||||
|
|
||||||
self.assertNotIn("one", out)
|
self.assertNotIn("one", out)
|
||||||
self.assertIn("two", out)
|
self.assertIn("two", out)
|
||||||
|
@ -105,7 +105,7 @@ class TestOperatorsIdentity(TestCase):
|
||||||
|
|
||||||
def test_colon_or_colon(self):
|
def test_colon_or_colon(self):
|
||||||
"""operator : or :"""
|
"""operator : or :"""
|
||||||
code, out, err = self.t(("ls", "project:A", "or", "priority:H"))
|
code, out, err = self.t("ls project:A or priority:H")
|
||||||
|
|
||||||
self.assertIn("one", out)
|
self.assertIn("one", out)
|
||||||
self.assertIn("two", out)
|
self.assertIn("two", out)
|
||||||
|
@ -114,7 +114,7 @@ class TestOperatorsIdentity(TestCase):
|
||||||
|
|
||||||
def test_colon_or_equal(self):
|
def test_colon_or_equal(self):
|
||||||
"""operator : or ="""
|
"""operator : or ="""
|
||||||
code, out, err = self.t(("ls", "project:A", "or", "priority=H"))
|
code, out, err = self.t("ls project:A or priority=H")
|
||||||
|
|
||||||
self.assertIn("one", out)
|
self.assertIn("one", out)
|
||||||
self.assertIn("two", out)
|
self.assertIn("two", out)
|
||||||
|
@ -123,7 +123,7 @@ class TestOperatorsIdentity(TestCase):
|
||||||
|
|
||||||
def test_equal_or_colon(self):
|
def test_equal_or_colon(self):
|
||||||
"""operator = or :"""
|
"""operator = or :"""
|
||||||
code, out, err = self.t(("ls", "project=A", "or", "priority:H"))
|
code, out, err = self.t("ls project=A or priority:H")
|
||||||
|
|
||||||
self.assertIn("one", out)
|
self.assertIn("one", out)
|
||||||
self.assertIn("two", out)
|
self.assertIn("two", out)
|
||||||
|
@ -132,7 +132,7 @@ class TestOperatorsIdentity(TestCase):
|
||||||
|
|
||||||
def test_equal_or_equal(self):
|
def test_equal_or_equal(self):
|
||||||
"""operator = or ="""
|
"""operator = or ="""
|
||||||
code, out, err = self.t(("ls", "project=A", "or", "priority=H"))
|
code, out, err = self.t("ls project=A or priority=H")
|
||||||
|
|
||||||
self.assertIn("one", out)
|
self.assertIn("one", out)
|
||||||
self.assertIn("two", out)
|
self.assertIn("two", out)
|
||||||
|
@ -141,7 +141,7 @@ class TestOperatorsIdentity(TestCase):
|
||||||
|
|
||||||
def test_colon_or_not_colon(self):
|
def test_colon_or_not_colon(self):
|
||||||
"""operator : or not :"""
|
"""operator : or not :"""
|
||||||
code, out, err = self.t(("ls", "project:A", "or", "priority.not:H"))
|
code, out, err = self.t("ls project:A or priority.not:H")
|
||||||
|
|
||||||
self.assertIn("one", out)
|
self.assertIn("one", out)
|
||||||
self.assertIn("two", out)
|
self.assertIn("two", out)
|
||||||
|
@ -152,7 +152,7 @@ class TestOperatorsIdentity(TestCase):
|
||||||
|
|
||||||
def test_colon_xor_colon(self):
|
def test_colon_xor_colon(self):
|
||||||
"""operator : xor :"""
|
"""operator : xor :"""
|
||||||
code, out, err = self.t(("ls", "project:A", "xor", "priority:H"))
|
code, out, err = self.t("ls project:A xor priority:H")
|
||||||
|
|
||||||
self.assertNotIn("one", out)
|
self.assertNotIn("one", out)
|
||||||
self.assertIn("two", out)
|
self.assertIn("two", out)
|
||||||
|
@ -161,7 +161,7 @@ class TestOperatorsIdentity(TestCase):
|
||||||
|
|
||||||
def test_colon_xor_equal(self):
|
def test_colon_xor_equal(self):
|
||||||
"""operator : xor ="""
|
"""operator : xor ="""
|
||||||
code, out, err = self.t(("ls", "project:A", "xor", "priority=H"))
|
code, out, err = self.t("ls project:A xor priority=H")
|
||||||
|
|
||||||
self.assertNotIn("one", out)
|
self.assertNotIn("one", out)
|
||||||
self.assertIn("two", out)
|
self.assertIn("two", out)
|
||||||
|
@ -170,7 +170,7 @@ class TestOperatorsIdentity(TestCase):
|
||||||
|
|
||||||
def test_equal_xor_colon(self):
|
def test_equal_xor_colon(self):
|
||||||
"""operator = xor :"""
|
"""operator = xor :"""
|
||||||
code, out, err = self.t(("ls", "project=A", "xor", "priority:H"))
|
code, out, err = self.t("ls project=A xor priority:H")
|
||||||
|
|
||||||
self.assertNotIn("one", out)
|
self.assertNotIn("one", out)
|
||||||
self.assertIn("two", out)
|
self.assertIn("two", out)
|
||||||
|
@ -179,7 +179,7 @@ class TestOperatorsIdentity(TestCase):
|
||||||
|
|
||||||
def test_equal_xor_equal(self):
|
def test_equal_xor_equal(self):
|
||||||
"""operator = xor ="""
|
"""operator = xor ="""
|
||||||
code, out, err = self.t(("ls", "project=A", "xor", "priority=H"))
|
code, out, err = self.t("ls project=A xor priority=H")
|
||||||
|
|
||||||
self.assertNotIn("one", out)
|
self.assertNotIn("one", out)
|
||||||
self.assertIn("two", out)
|
self.assertIn("two", out)
|
||||||
|
@ -188,7 +188,7 @@ class TestOperatorsIdentity(TestCase):
|
||||||
|
|
||||||
def test_colon_xor_not_colon(self):
|
def test_colon_xor_not_colon(self):
|
||||||
"""operator : xor not :"""
|
"""operator : xor not :"""
|
||||||
code, out, err = self.t(("ls", "project:A", "xor", "priority.not:H"))
|
code, out, err = self.t("ls project:A xor priority.not:H")
|
||||||
|
|
||||||
self.assertIn("one", out)
|
self.assertIn("one", out)
|
||||||
self.assertNotIn("two", out)
|
self.assertNotIn("two", out)
|
||||||
|
@ -201,17 +201,17 @@ class TestOperatorsQuantity(TestCase):
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
cls.t = Task()
|
cls.t = Task()
|
||||||
|
|
||||||
cls.t(("add", "one", "due:yesterday", "priority:H"))
|
cls.t("add one due:yesterday priority:H")
|
||||||
cls.t(("add", "two", "due:tomorrow", "priority:M"))
|
cls.t("add two due:tomorrow priority:M")
|
||||||
cls.t(("add", "three", "priority:L"))
|
cls.t("add three priority:L")
|
||||||
cls.t(("add", "four"))
|
cls.t("add four")
|
||||||
cls.t(("add", "five", "due:today"))
|
cls.t("add five due:today")
|
||||||
|
|
||||||
# > operator #
|
# > operator #
|
||||||
|
|
||||||
def test_due_after(self):
|
def test_due_after(self):
|
||||||
"""operator due.after:today"""
|
"""operator due.after:today"""
|
||||||
code, out, err = self.t(("ls", "due.after:today"))
|
code, out, err = self.t("ls due.after:today")
|
||||||
|
|
||||||
self.assertNotIn("one", out)
|
self.assertNotIn("one", out)
|
||||||
self.assertIn("two", out)
|
self.assertIn("two", out)
|
||||||
|
@ -221,7 +221,7 @@ class TestOperatorsQuantity(TestCase):
|
||||||
|
|
||||||
def test_due_greater(self):
|
def test_due_greater(self):
|
||||||
"""operator due > today"""
|
"""operator due > today"""
|
||||||
code, out, err = self.t(("ls", "due", ">", "today"))
|
code, out, err = self.t("ls due > today")
|
||||||
|
|
||||||
self.assertNotIn("one", out)
|
self.assertNotIn("one", out)
|
||||||
self.assertIn("two", out)
|
self.assertIn("two", out)
|
||||||
|
@ -231,7 +231,7 @@ class TestOperatorsQuantity(TestCase):
|
||||||
|
|
||||||
def test_priority_above(self):
|
def test_priority_above(self):
|
||||||
"""operator priority.above:M"""
|
"""operator priority.above:M"""
|
||||||
code, out, err = self.t(("ls", "priority.above:M"))
|
code, out, err = self.t("ls priority.above:M")
|
||||||
|
|
||||||
self.assertIn("one", out)
|
self.assertIn("one", out)
|
||||||
self.assertNotIn("two", out)
|
self.assertNotIn("two", out)
|
||||||
|
@ -241,7 +241,7 @@ class TestOperatorsQuantity(TestCase):
|
||||||
|
|
||||||
def test_priority_greater(self):
|
def test_priority_greater(self):
|
||||||
"""operator priority > M"""
|
"""operator priority > M"""
|
||||||
code, out, err = self.t(("ls", "priority", ">", "M"))
|
code, out, err = self.t("ls priority > M")
|
||||||
|
|
||||||
self.assertIn("one", out)
|
self.assertIn("one", out)
|
||||||
self.assertNotIn("two", out)
|
self.assertNotIn("two", out)
|
||||||
|
@ -251,7 +251,7 @@ class TestOperatorsQuantity(TestCase):
|
||||||
|
|
||||||
def test_description_greater(self):
|
def test_description_greater(self):
|
||||||
"""operator description > o"""
|
"""operator description > o"""
|
||||||
code, out, err = self.t(("ls", "description", ">", "o"))
|
code, out, err = self.t("ls description > o")
|
||||||
|
|
||||||
self.assertIn("one", out)
|
self.assertIn("one", out)
|
||||||
self.assertIn("two", out)
|
self.assertIn("two", out)
|
||||||
|
@ -261,7 +261,7 @@ class TestOperatorsQuantity(TestCase):
|
||||||
|
|
||||||
def test_urgency_greater(self):
|
def test_urgency_greater(self):
|
||||||
"""operator urgency > 10.0"""
|
"""operator urgency > 10.0"""
|
||||||
code, out, err = self.t(("ls", "urgency", ">", "10.0"))
|
code, out, err = self.t("ls urgency > 10.0")
|
||||||
|
|
||||||
self.assertIn("one", out)
|
self.assertIn("one", out)
|
||||||
self.assertIn("two", out)
|
self.assertIn("two", out)
|
||||||
|
@ -273,7 +273,7 @@ class TestOperatorsQuantity(TestCase):
|
||||||
|
|
||||||
def test_due_before(self):
|
def test_due_before(self):
|
||||||
"""operator due.before:today"""
|
"""operator due.before:today"""
|
||||||
code, out, err = self.t(("ls", "due.before:today"))
|
code, out, err = self.t("ls due.before:today")
|
||||||
|
|
||||||
self.assertIn("one", out)
|
self.assertIn("one", out)
|
||||||
self.assertNotIn("two", out)
|
self.assertNotIn("two", out)
|
||||||
|
@ -283,7 +283,7 @@ class TestOperatorsQuantity(TestCase):
|
||||||
|
|
||||||
def test_due_smaller(self):
|
def test_due_smaller(self):
|
||||||
"""operator due < today"""
|
"""operator due < today"""
|
||||||
code, out, err = self.t(("ls", "due", "<", "today"))
|
code, out, err = self.t("ls due < today")
|
||||||
|
|
||||||
self.assertIn("one", out)
|
self.assertIn("one", out)
|
||||||
self.assertNotIn("two", out)
|
self.assertNotIn("two", out)
|
||||||
|
@ -293,7 +293,7 @@ class TestOperatorsQuantity(TestCase):
|
||||||
|
|
||||||
def test_priority_below(self):
|
def test_priority_below(self):
|
||||||
"""operator priority.below:M"""
|
"""operator priority.below:M"""
|
||||||
code, out, err = self.t(("ls", "priority.below:M"))
|
code, out, err = self.t("ls priority.below:M")
|
||||||
|
|
||||||
self.assertNotIn("one", out)
|
self.assertNotIn("one", out)
|
||||||
self.assertNotIn("two", out)
|
self.assertNotIn("two", out)
|
||||||
|
@ -303,7 +303,7 @@ class TestOperatorsQuantity(TestCase):
|
||||||
|
|
||||||
def test_priority_smaller(self):
|
def test_priority_smaller(self):
|
||||||
"""operator priority < M"""
|
"""operator priority < M"""
|
||||||
code, out, err = self.t(("ls", "priority", "<", "M"))
|
code, out, err = self.t("ls priority < M")
|
||||||
|
|
||||||
self.assertNotIn("one", out)
|
self.assertNotIn("one", out)
|
||||||
self.assertNotIn("two", out)
|
self.assertNotIn("two", out)
|
||||||
|
@ -313,7 +313,7 @@ class TestOperatorsQuantity(TestCase):
|
||||||
|
|
||||||
def test_description_smaller(self):
|
def test_description_smaller(self):
|
||||||
"""operator description < o"""
|
"""operator description < o"""
|
||||||
code, out, err = self.t(("ls", "description", "<", "o"))
|
code, out, err = self.t("ls description < o")
|
||||||
|
|
||||||
self.assertNotIn("one", out)
|
self.assertNotIn("one", out)
|
||||||
self.assertNotIn("two", out)
|
self.assertNotIn("two", out)
|
||||||
|
@ -323,7 +323,7 @@ class TestOperatorsQuantity(TestCase):
|
||||||
|
|
||||||
def test_urgency_smaller(self):
|
def test_urgency_smaller(self):
|
||||||
"""operator urgency < 10.0"""
|
"""operator urgency < 10.0"""
|
||||||
code, out, err = self.t(("ls", "urgency", "<", "10.0"))
|
code, out, err = self.t("ls urgency < 10.0")
|
||||||
|
|
||||||
self.assertNotIn("one", out)
|
self.assertNotIn("one", out)
|
||||||
self.assertNotIn("two", out)
|
self.assertNotIn("two", out)
|
||||||
|
@ -335,7 +335,7 @@ class TestOperatorsQuantity(TestCase):
|
||||||
|
|
||||||
def test_due_greater_equal(self):
|
def test_due_greater_equal(self):
|
||||||
"""operator due >= today"""
|
"""operator due >= today"""
|
||||||
code, out, err = self.t(("ls", "due", ">=", "today"))
|
code, out, err = self.t("ls due >= today")
|
||||||
|
|
||||||
self.assertNotIn("one", out)
|
self.assertNotIn("one", out)
|
||||||
self.assertIn("two", out)
|
self.assertIn("two", out)
|
||||||
|
@ -345,7 +345,7 @@ class TestOperatorsQuantity(TestCase):
|
||||||
|
|
||||||
def test_priority_greater_equal(self):
|
def test_priority_greater_equal(self):
|
||||||
"""operator priority >= M"""
|
"""operator priority >= M"""
|
||||||
code, out, err = self.t(("ls", "priority", ">=", "M"))
|
code, out, err = self.t("ls priority >= M")
|
||||||
|
|
||||||
self.assertIn("one", out)
|
self.assertIn("one", out)
|
||||||
self.assertIn("two", out)
|
self.assertIn("two", out)
|
||||||
|
@ -355,7 +355,7 @@ class TestOperatorsQuantity(TestCase):
|
||||||
|
|
||||||
def test_description_greater_equal(self):
|
def test_description_greater_equal(self):
|
||||||
"""operator description >= o"""
|
"""operator description >= o"""
|
||||||
code, out, err = self.t(("ls", "description", ">=", "o"))
|
code, out, err = self.t("ls description >= o")
|
||||||
|
|
||||||
# NOTE >= is > + ==, not > + =
|
# NOTE >= is > + ==, not > + =
|
||||||
# a single = is a partial match, check: task calc 'a = aa' vs 'a == aa'
|
# a single = is a partial match, check: task calc 'a = aa' vs 'a == aa'
|
||||||
|
@ -367,7 +367,7 @@ class TestOperatorsQuantity(TestCase):
|
||||||
|
|
||||||
def test_urgency_greater_equal(self):
|
def test_urgency_greater_equal(self):
|
||||||
"""operator urgency >= 10.0"""
|
"""operator urgency >= 10.0"""
|
||||||
code, out, err = self.t(("ls", "urgency", ">=", "10.0"))
|
code, out, err = self.t("ls urgency >= 10.0")
|
||||||
|
|
||||||
self.assertIn("one", out)
|
self.assertIn("one", out)
|
||||||
self.assertIn("two", out)
|
self.assertIn("two", out)
|
||||||
|
@ -379,7 +379,7 @@ class TestOperatorsQuantity(TestCase):
|
||||||
|
|
||||||
def test_due_smaller_equal(self):
|
def test_due_smaller_equal(self):
|
||||||
"""operator due <= today"""
|
"""operator due <= today"""
|
||||||
code, out, err = self.t(("ls", "due", "<=", "today"))
|
code, out, err = self.t("ls due <= today")
|
||||||
|
|
||||||
self.assertIn("one", out)
|
self.assertIn("one", out)
|
||||||
self.assertNotIn("two", out)
|
self.assertNotIn("two", out)
|
||||||
|
@ -389,7 +389,7 @@ class TestOperatorsQuantity(TestCase):
|
||||||
|
|
||||||
def test_priority_smaller_equal(self):
|
def test_priority_smaller_equal(self):
|
||||||
"""operator priority <= M"""
|
"""operator priority <= M"""
|
||||||
code, out, err = self.t(("ls", "priority", "<=", "M"))
|
code, out, err = self.t("ls priority <= M")
|
||||||
|
|
||||||
self.assertNotIn("one", out)
|
self.assertNotIn("one", out)
|
||||||
self.assertIn("two", out)
|
self.assertIn("two", out)
|
||||||
|
@ -399,7 +399,7 @@ class TestOperatorsQuantity(TestCase):
|
||||||
|
|
||||||
def test_description_smaller_equal(self):
|
def test_description_smaller_equal(self):
|
||||||
"""operator description <= o"""
|
"""operator description <= o"""
|
||||||
code, out, err = self.t(("ls", "description", "<=", "o"))
|
code, out, err = self.t("ls description <= o")
|
||||||
|
|
||||||
# NOTE <= is < + ==, not < + =
|
# NOTE <= is < + ==, not < + =
|
||||||
# a single = is a partial match, check: task calc 'a = aa' vs 'a == aa'
|
# a single = is a partial match, check: task calc 'a = aa' vs 'a == aa'
|
||||||
|
@ -411,7 +411,7 @@ class TestOperatorsQuantity(TestCase):
|
||||||
|
|
||||||
def test_urgency_smaller_equal(self):
|
def test_urgency_smaller_equal(self):
|
||||||
"""operator urgency <= 10.0"""
|
"""operator urgency <= 10.0"""
|
||||||
code, out, err = self.t(("ls", "urgency", "<=", "10.0"))
|
code, out, err = self.t("ls urgency <= 10.0")
|
||||||
|
|
||||||
self.assertNotIn("one", out)
|
self.assertNotIn("one", out)
|
||||||
self.assertNotIn("two", out)
|
self.assertNotIn("two", out)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue