From 8e21620d279e501fcdcacf6ef6dec6cc7397db0e Mon Sep 17 00:00:00 2001 From: Paul Pogonyshev Date: Mon, 11 Aug 2008 20:29:27 +0000 Subject: Bug 540376 – No TypeError raised when type is None MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2008-08-11 Paul Pogonyshev Bug 540376 – No TypeError raised when type is None * gobject/gobjectmodule.c (pyg_signal_new): Add check on second argument type. * tests/test_signal.py (TestSignalCreation): New test case. svn path=/trunk/; revision=942 --- tests/test_signal.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests') diff --git a/tests/test_signal.py b/tests/test_signal.py index 6c41ece..96e0731 100644 --- a/tests/test_signal.py +++ b/tests/test_signal.py @@ -17,6 +17,16 @@ class D(C): self.arg2 = arg2 C.do_my_signal(self, arg2) +class TestSignalCreation(unittest.TestCase): + # Bug 540376. + def test_illegals(self): + self.assertRaises(TypeError, lambda: gobject.signal_new('test', + None, + 0, + gobject.TYPE_NONE, + (gobject.TYPE_LONG,))) + + class TestChaining(unittest.TestCase): def setUp(self): self.inst = C() -- cgit