diff options
Diffstat (limited to 'tests/test_interface.py')
-rw-r--r-- | tests/test_interface.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/test_interface.py b/tests/test_interface.py new file mode 100644 index 0000000..2e45e1d --- /dev/null +++ b/tests/test_interface.py @@ -0,0 +1,25 @@ +import unittest + +import testmodule +from common import gobject, testhelper +from gobject import GObject, GInterface + +GUnknown = gobject.type_from_name("TestUnknown") +Unknown = GUnknown.pytype + +class MyUnknown(Unknown, testhelper.Interface): + def __init__(self): + Unknown.__init__(self) + self.called = False + + def do_iface_method(self): + self.called = True + Unknown.do_iface_method(self) + +gobject.type_register(MyUnknown) + +class TestIfaceImpl(unittest.TestCase): + def testMethodCall(self): + m = MyUnknown() + m.iface_method() + self.assertEqual(m.called, True) |