From d96aaf253b925d4e84374f5c7e79398c21eff72f Mon Sep 17 00:00:00 2001 From: James Livingstone Date: Mon, 30 Apr 2007 02:50:06 +0000 Subject: reviewed by: Johan Dahlin 2007-04-29 James Livingstone reviewed by: Johan Dahlin * gobject/pygtype.c: (pyg_value_from_pyobject): * tests/test_signal.py: Add a missing else to avoid throwing a TypeError. Includes a test written by Ed Catmur. Fixes #374653 svn path=/trunk/; revision=657 --- tests/test_signal.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tests') diff --git a/tests/test_signal.py b/tests/test_signal.py index 99bb45b..6c41ece 100644 --- a/tests/test_signal.py +++ b/tests/test_signal.py @@ -2,6 +2,7 @@ import gc import unittest +import sys from common import gobject, testhelper @@ -364,5 +365,19 @@ else: print '** WARNING: LIBFFI disabled, not testing' print +# Test for 374653 +class TestPyGValue(unittest.TestCase): + def testNoneNULLBoxedConversion(self): + class C(gobject.GObject): + __gsignals__ = dict(my_boxed_signal=( + gobject.SIGNAL_RUN_LAST, + gobject.type_from_name('GStrv'), ())) + + obj = C() + obj.connect('my-boxed-signal', lambda obj: None) + sys.last_type = None + obj.emit('my-boxed-signal') + assert not sys.last_type + if __name__ == '__main__': unittest.main() -- cgit