X-Git-Url: https://git.madduck.net/etc/taskwarrior.git/blobdiff_plain/27f93e251029f1d93c92d8e1ac6a254bdb70ecdd..6220d716c07a841b77fba60d50d1e2b57851af84:/tasklib/tests.py diff --git a/tasklib/tests.py b/tasklib/tests.py index 3ff1ebf..2aebdcb 100644 --- a/tasklib/tests.py +++ b/tasklib/tests.py @@ -125,6 +125,8 @@ class TaskFilterTest(TasklibTest): filtered_task = self.tw.tasks.get(project="random") self.assertEqual(filtered_task['project'], "random") + def test_filter_with_empty_uuid(self): + self.assertRaises(ValueError, lambda: self.tw.tasks.get(uuid='')) class TaskTest(TasklibTest): @@ -495,11 +497,17 @@ class TaskTest(TasklibTest): for deserializer in deserializers: self.assertTrue(deserializer('') in (None, [], set())) - def test_normalizers_returning_empty_string_for_none(self): + def test_normalizers_handling_none(self): # Test that any normalizer can handle None as a valid value t = Task(self.tw) + + # These normalizers are not supposed to handle None + exempt_normalizers = ('normalize_uuid', ) + normalizers = [getattr(t, normalizer_name) for normalizer_name in - filter(lambda x: x.startswith('normalize_'), dir(t))] + filter(lambda x: x.startswith('normalize_'), dir(t)) + if normalizer_name not in exempt_normalizers] + for normalizer in normalizers: normalizer(None)