diff options
author | Gustavo J. A. M. Carneiro <gjc@src.gnome.org> | 2005-07-31 15:16:39 +0000 |
---|---|---|
committer | Gustavo J. A. M. Carneiro <gjc@src.gnome.org> | 2005-07-31 15:16:39 +0000 |
commit | ca9f9bd7c784486b1f712445d0659ea3ba19099c (patch) | |
tree | 2e5e99eddfcd0bfccc8b3bfbfc3ac09a33fba75d /tests/test_subtype.py | |
parent | dbe675b374ec62cb25825dae41a10f163faa87c4 (diff) | |
download | pygobject-ca9f9bd7c784486b1f712445d0659ea3ba19099c.tar.gz pygobject-ca9f9bd7c784486b1f712445d0659ea3ba19099c.tar.xz pygobject-ca9f9bd7c784486b1f712445d0659ea3ba19099c.zip |
Fix reference count of gtk.Window's from gobject.new
Diffstat (limited to 'tests/test_subtype.py')
-rw-r--r-- | tests/test_subtype.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/test_subtype.py b/tests/test_subtype.py index a48452c..630344c 100644 --- a/tests/test_subtype.py +++ b/tests/test_subtype.py @@ -52,3 +52,21 @@ class TestSubType(unittest.TestCase): continue subname = name + "PyGtkTestSubclass" sub = type(subname, (cls,), {'__gtype_name__': subname }) + + def testGtkWindowObjNewRefcount(self): + foo = gobject.new(gtk.Window) + self.assertEqual(foo.__grefcount__, 2) + + def testGtkWindowFactoryRefcount(self): + foo = gtk.Window() + self.assertEqual(foo.__grefcount__, 2) + + def testPyWindowObjNewRefcount(self): + PyWindow = type('PyWindow', (gtk.Window,), dict(__gtype_name__='PyWindow1')) + foo = gobject.new(PyWindow) + self.assertEqual(foo.__grefcount__, 2) + + def testGtkWindowFactoryRefcount(self): + PyWindow = type('PyWindow', (gtk.Window,), dict(__gtype_name__='PyWindow2')) + foo = PyWindow() + self.assertEqual(foo.__grefcount__, 2) |