diff options
author | Tomeu Vizoso <tomeu@sugarlabs.org> | 2010-04-18 13:11:11 -0400 |
---|---|---|
committer | Tomeu Vizoso <tomeu@sugarlabs.org> | 2010-04-18 13:15:07 -0400 |
commit | 8b70faa7a9a32b9ea8862f28a503e38f496cfd89 (patch) | |
tree | 139df2373cdc05b308dfd87ea46699eee8999f13 /tests/test_gi.py | |
parent | e239faacb4798fe2d166233ca1a19a843a6225e3 (diff) | |
download | pygi-8b70faa7a9a32b9ea8862f28a503e38f496cfd89.tar.gz pygi-8b70faa7a9a32b9ea8862f28a503e38f496cfd89.tar.xz pygi-8b70faa7a9a32b9ea8862f28a503e38f496cfd89.zip |
Implement vfuncs.
https://bugzilla.gnome.org/show_bug.cgi?id=602736
Diffstat (limited to 'tests/test_gi.py')
-rw-r--r-- | tests/test_gi.py | 18 |
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): |