Test: Change most tests to use "add test" instead of split arguments
This commit is contained in:
@@ -17,15 +17,11 @@ class TestBug1262(TestCase):
|
||||
def setUpClass(cls):
|
||||
cls.t = Task()
|
||||
|
||||
command = ("add", "Buy oranges")
|
||||
cls.t(command)
|
||||
|
||||
command = ("add", "Buy apples")
|
||||
cls.t(command)
|
||||
cls.t('add "Buy oranges"')
|
||||
cls.t('add "Buy apples"')
|
||||
|
||||
cls.DEPS = ("1", "2")
|
||||
command = ("add", "dep:" + ",".join(cls.DEPS), "Make fruit salad!")
|
||||
cls.t(command)
|
||||
cls.t("add dep:" + ",".join(cls.DEPS) + '"Make fruit salad!"')
|
||||
|
||||
def test_dependency_contains_matches_ID(self):
|
||||
"""dep.contains matches task IDs"""
|
||||
@@ -34,25 +30,24 @@ class TestBug1262(TestCase):
|
||||
# fail, which means it's actually using the UUID.
|
||||
# Still, it passes on most cases. Which is WRONG!.
|
||||
for char in self.DEPS:
|
||||
self.t(("list", "dep.contains:{0}".format(char)))
|
||||
self.t("list dep.contains:{0}".format(char))
|
||||
|
||||
def test_dependency_contains_not_matches_other(self):
|
||||
"""dep.contains matches other characters not present in ID nor UUID"""
|
||||
for char in set(string.letters).difference(string.hexdigits):
|
||||
self.t.runError(("list", "dep.contains:{0}".format(char)))
|
||||
self.t.runError("list dep.contains:{0}".format(char))
|
||||
|
||||
def test_dependency_contains_not_UUID(self):
|
||||
"""dep.contains matches characters in the tasks' UUIDs"""
|
||||
# Get the UUID of the task with description "Buy"
|
||||
command = ("uuid", "Buy")
|
||||
code, out, err = self.t(command)
|
||||
code, out, err = self.t("uuid Buy")
|
||||
|
||||
# Get only characters that show up in the UUID
|
||||
uuid = {chr for chr in out.splitlines()[0] if chr in string.hexdigits}
|
||||
|
||||
for char in uuid:
|
||||
if char not in self.DEPS:
|
||||
self.t.runError(("list", "dep.contains:{0}".format(char)))
|
||||
self.t.runError("list dep.contains:{0}".format(char))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user