diff options
Diffstat (limited to 'tests/test_interface.py')
-rw-r--r-- | tests/test_interface.py | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/tests/test_interface.py b/tests/test_interface.py index 2e45e1d..d54515d 100644 --- a/tests/test_interface.py +++ b/tests/test_interface.py @@ -8,6 +8,11 @@ GUnknown = gobject.type_from_name("TestUnknown") Unknown = GUnknown.pytype class MyUnknown(Unknown, testhelper.Interface): + __gproperties__ = { + 'some-property': (str, 'blurb', 'description', 'default', + gobject.PARAM_READWRITE), + } + def __init__(self): Unknown.__init__(self) self.called = False @@ -18,8 +23,31 @@ class MyUnknown(Unknown, testhelper.Interface): gobject.type_register(MyUnknown) +class MyObject(gobject.GObject, testhelper.Interface): + __gproperties__ = { + 'some-property': (str, 'blurb', 'description', 'default', + gobject.PARAM_READWRITE), + } + + def __init__(self): + GObject.__init__(self) + self.called = False + + def do_iface_method(self): + self.called = True + +gobject.type_register(MyObject) + + class TestIfaceImpl(unittest.TestCase): - def testMethodCall(self): + + def testReImplementInterface(self): m = MyUnknown() m.iface_method() self.assertEqual(m.called, True) + + def testImplementInterface(self): + m = MyObject() + m.iface_method() + self.assertEqual(m.called, True) + |