summaryrefslogtreecommitdiffstats
path: root/tests/test_gi.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_gi.py')
-rw-r--r--tests/test_gi.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/test_gi.py b/tests/test_gi.py
index b37dce4..9f3c215 100644
--- a/tests/test_gi.py
+++ b/tests/test_gi.py
@@ -1313,10 +1313,17 @@ class TestPythonGObject(unittest.TestCase):
class Object(GIMarshallingTests.Object):
__gtype_name__ = "Object"
+ def __init__(self, int):
+ GIMarshallingTests.Object.__init__(self)
+ self.val = None
+
def method(self):
# Don't call super, which asserts that self.int == 42.
pass
+ def do_method_int8_in(self, int8):
+ self.val = int8
+
def test_object(self):
self.assertTrue(issubclass(self.Object, GIMarshallingTests.Object))
@@ -1326,6 +1333,11 @@ class TestPythonGObject(unittest.TestCase):
def test_object_method(self):
self.Object(int = 0).method()
+ def test_object_vfuncs(self):
+ object_ = self.Object(int = 42)
+ object_.method_int8_in(84)
+ self.assertEqual(object_.val, 84)
+
class TestMultiOutputArgs(unittest.TestCase):
@@ -1351,12 +1363,18 @@ class TestInterfaces(unittest.TestCase):
__gtype_name__ = 'TestInterfaceImpl'
def __init__(self):
gobject.GObject.__init__(self)
+ self.val = None
+
+ def do_test_int8_in(self, int8):
+ self.val = int8
self.assertTrue(issubclass(TestInterfaceImpl, GIMarshallingTests.Interface))
instance = TestInterfaceImpl()
self.assertTrue(isinstance(instance, GIMarshallingTests.Interface))
+ GIMarshallingTests.test_interface_test_int8_in(instance, 42)
+ self.assertEquals(instance.val, 42)
class TestOverrides(unittest.TestCase):