summaryrefslogtreecommitdiff
path: root/tests/test_gi.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_gi.py')
-rw-r--r--tests/test_gi.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/test_gi.py b/tests/test_gi.py
index 2671588..13e87f4 100644
--- a/tests/test_gi.py
+++ b/tests/test_gi.py
@@ -2074,6 +2074,9 @@ class TestPythonGObject(unittest.TestCase):
def do_method_with_default_implementation(self, int8):
self.val = int8
+ def do_vfunc_return_value_only(self):
+ return 2121
+
class Interface3Impl(GObject.Object, GIMarshallingTests.Interface3):
def __init__(self):
GObject.Object.__init__(self)
@@ -2147,6 +2150,10 @@ class TestPythonGObject(unittest.TestCase):
object_.method_with_default_implementation(87)
self.assertEqual(object_.val, 87)
+ def test_subobject_child_vfunc(self):
+ object_ = self.SubObject(int=1)
+ self.assertEqual(object_.vfunc_return_value_only(), 2121)
+
def test_dynamic_module(self):
from gi.module import DynamicModule
self.assertTrue(isinstance(GObject, DynamicModule))
@@ -2288,6 +2295,21 @@ class TestInterfaces(unittest.TestCase):
GIMarshallingTests.test_interface_test_int8_in(instance, 42)
self.assertEqual(instance.val, 42)
+ def test_subclass_override(self):
+ class TestInterfaceImplD(TestInterfaces.TestInterfaceImpl):
+ val2 = None
+
+ def do_test_int8_in(self, int8):
+ self.val2 = int8
+
+ instance = TestInterfaceImplD()
+ self.assertEqual(instance.val, None)
+ self.assertEqual(instance.val2, None)
+
+ GIMarshallingTests.test_interface_test_int8_in(instance, 42)
+ self.assertEqual(instance.val, None)
+ self.assertEqual(instance.val2, 42)
+
def test_mro(self):
# there was a problem with Python bailing out because of
# http://en.wikipedia.org/wiki/Diamond_problem with interfaces,