summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_subtype.py18
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)