From c8085cbd1b83ba69ddb76c2d1a4dbfb5b1eb10ea Mon Sep 17 00:00:00 2001 From: hut Date: Wed, 31 Mar 2010 05:16:47 +0200 Subject: removed RegexpSignalDispatcher, I don't use it --- test/tc_signal.py | 43 ------------------------------------------- 1 file changed, 43 deletions(-) (limited to 'test') diff --git a/test/tc_signal.py b/test/tc_signal.py index feba3e5b..35b4eebe 100644 --- a/test/tc_signal.py +++ b/test/tc_signal.py @@ -130,48 +130,5 @@ class TestSignal(unittest.TestCase): self.assertEqual('ab', ''.join(alphabet)) self.assertTrue(is_deleted[0]) - - def test_regexp_signals(self): - sd = RegexpSignalDispatcher() - lst = [] - def modify(s): - s.number = 5 - def set_number(s): - lst.append(s.number) - def stopit(s): - s.stop() - - h1 = sd.signal_bind_regexp('.*ar', modify, priority=1) - - sd.signal_bind('xyz', set_number) - sd.signal_bind('foobar', set_number) - - sd.signal_emit('xyz', number=10) - self.assertEqual(10, lst[-1]) - sd.signal_emit('foobar', number=10) - self.assertEqual(5, lst[-1]) - - h2 = sd.signal_bind_regexp('x.z', modify, priority=1) -# print(sd._signals) - - sd.signal_emit('xyz', number=10) - self.assertEqual(5, lst[-1]) - sd.signal_emit('foobar', number=10) - self.assertEqual(5, lst[-1]) - - sd.signal_unbind(h2) - - sd.signal_emit('xyz', number=10) - self.assertEqual(10, lst[-1]) - sd.signal_emit('foobar', number=10) - self.assertEqual(5, lst[-1]) - - sd.signal_unbind(h1) - - sd.signal_emit('xyz', number=10) - self.assertEqual(10, lst[-1]) - sd.signal_emit('foobar', number=10) - self.assertEqual(10, lst[-1]) - if __name__ == '__main__': unittest.main() -- cgit 1.4.1-2-gfad0