summaryrefslogtreecommitdiff
path: root/taskflow/tests/unit/test_notifier.py
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2014-12-01 21:44:45 -0800
committerJoshua Harlow <harlowja@yahoo-inc.com>2014-12-02 12:47:03 -0800
commit14ecaa45503c8a0efcb5972f342de171b4b8cd9b (patch)
tree5f0b08d011e6bb7c2830b319887dfc6b0df02515 /taskflow/tests/unit/test_notifier.py
parent96a387f66f5d151259601b86047eec8eee72df6c (diff)
downloadtaskflow-14ecaa45503c8a0efcb5972f342de171b4b8cd9b.tar.gz
Raise value errors instead of asserts
Since asserts can be silenced using -0 and/or compiled out we want to be more strict here and raise value errors when the expected callable objects/functions are not actually callable. Change-Id: Ib14e2e7329dbfcce50660f144ad4780d99f36854
Diffstat (limited to 'taskflow/tests/unit/test_notifier.py')
-rw-r--r--taskflow/tests/unit/test_notifier.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/taskflow/tests/unit/test_notifier.py b/taskflow/tests/unit/test_notifier.py
index 0761cb6..ab53607 100644
--- a/taskflow/tests/unit/test_notifier.py
+++ b/taskflow/tests/unit/test_notifier.py
@@ -79,6 +79,11 @@ class NotifierTest(test.TestCase):
nt.Notifier.ANY, call_me,
kwargs={'details': 5})
+ def test_not_callable(self):
+ notifier = nt.Notifier()
+ self.assertRaises(ValueError, notifier.register,
+ nt.Notifier.ANY, 2)
+
def test_selective_notify(self):
call_counts = collections.defaultdict(list)