5 from gi.repository import GObject
9 GUnknown = GObject.type_from_name("TestUnknown")
10 Unknown = GUnknown.pytype
13 class MyUnknown(Unknown, testhelper.Interface):
14 some_property = GObject.Property(type=str)
17 Unknown.__init__(self)
20 def do_iface_method(self):
22 Unknown.do_iface_method(self)
23 GObject.type_register(MyUnknown)
26 class MyObject(GObject.GObject, testhelper.Interface):
27 some_property = GObject.Property(type=str)
30 GObject.GObject.__init__(self)
33 def do_iface_method(self):
35 GObject.type_register(MyObject)
38 class TestIfaceImpl(unittest.TestCase):
40 def test_reimplement_interface(self):
43 self.assertEqual(m.called, True)
45 def test_implement_interface(self):
48 self.assertEqual(m.called, True)