diff options
author | Tim Graham <timograham@gmail.com> | 2015-01-02 11:29:06 -0500 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2015-01-02 11:29:06 -0500 |
commit | 937fab030d48021ccd266c67016aeaef91362e2c (patch) | |
tree | 99646f11e8de9eddf7ba4441f651929a062ce0f7 /tests/dispatch | |
parent | 8958170755b37ce346ae5257c1000bd936faa3b0 (diff) | |
download | django-937fab030d48021ccd266c67016aeaef91362e2c.tar.gz |
Renamed an assertion in the dispatch tests.
Diffstat (limited to 'tests/dispatch')
-rw-r--r-- | tests/dispatch/tests.py | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/tests/dispatch/tests.py b/tests/dispatch/tests.py index deee6a2b78..aaa2dc0daa 100644 --- a/tests/dispatch/tests.py +++ b/tests/dispatch/tests.py @@ -45,7 +45,7 @@ d_signal = Signal(providing_args=["val"], use_caching=True) class DispatcherTests(unittest.TestCase): """Test suite for dispatcher (barely started)""" - def _testIsClean(self, signal): + def assertTestIsClean(self, signal): """Assert that everything has been cleaned up automatically""" # Note that dead weakref cleanup happens as side effect of using # the signal's receivers through the signals API. So, first do a @@ -59,7 +59,7 @@ class DispatcherTests(unittest.TestCase): result = a_signal.send(sender=self, val="test") self.assertEqual(result, expected) a_signal.disconnect(receiver_1_arg, sender=self) - self._testIsClean(a_signal) + self.assertTestIsClean(a_signal) def test_ignored_sender(self): a_signal.connect(receiver_1_arg) @@ -67,7 +67,7 @@ class DispatcherTests(unittest.TestCase): result = a_signal.send(sender=self, val="test") self.assertEqual(result, expected) a_signal.disconnect(receiver_1_arg) - self._testIsClean(a_signal) + self.assertTestIsClean(a_signal) def test_garbage_collected(self): a = Callable() @@ -77,7 +77,7 @@ class DispatcherTests(unittest.TestCase): garbage_collect() result = a_signal.send(sender=self, val="test") self.assertEqual(result, expected) - self._testIsClean(a_signal) + self.assertTestIsClean(a_signal) def test_cached_garbaged_collected(self): """ @@ -111,7 +111,7 @@ class DispatcherTests(unittest.TestCase): del a del result garbage_collect() - self._testIsClean(a_signal) + self.assertTestIsClean(a_signal) def test_uid_registration(self): def uid_based_receiver_1(**kwargs): @@ -124,10 +124,10 @@ class DispatcherTests(unittest.TestCase): a_signal.connect(uid_based_receiver_2, dispatch_uid="uid") self.assertEqual(len(a_signal.receivers), 1) a_signal.disconnect(dispatch_uid="uid") - self._testIsClean(a_signal) + self.assertTestIsClean(a_signal) def test_robust(self): - """Test the sendRobust function""" + """Test the send_robust() function""" def fails(val, **kwargs): raise ValueError('this') a_signal.connect(fails) @@ -138,7 +138,7 @@ class DispatcherTests(unittest.TestCase): self.assertTrue(hasattr(err, '__traceback__')) self.assertTrue(isinstance(err.__traceback__, TracebackType)) a_signal.disconnect(fails) - self._testIsClean(a_signal) + self.assertTestIsClean(a_signal) def test_disconnection(self): receiver_1 = Callable() @@ -151,7 +151,7 @@ class DispatcherTests(unittest.TestCase): del receiver_2 garbage_collect() a_signal.disconnect(receiver_3) - self._testIsClean(a_signal) + self.assertTestIsClean(a_signal) def test_has_listeners(self): self.assertFalse(a_signal.has_listeners()) @@ -168,7 +168,6 @@ class DispatcherTests(unittest.TestCase): class ReceiverTestCase(unittest.TestCase): """ Test suite for receiver. - """ def test_receiver_single_signal(self): @receiver(a_signal) |