diff options
author | Gustavo J. A. M. Carneiro <gjc@src.gnome.org> | 2006-08-27 12:02:33 +0000 |
---|---|---|
committer | Gustavo J. A. M. Carneiro <gjc@src.gnome.org> | 2006-08-27 12:02:33 +0000 |
commit | d05fccab23aef7fa4c406352552262782bf1066c (patch) | |
tree | 0e35f797d3aaacf586384e343120ea06f8ae5358 /tests/test_interface.py | |
parent | 3938273dfd085dc75f64ce44706cf508fd971099 (diff) | |
download | pygobject-d05fccab23aef7fa4c406352552262782bf1066c.tar.gz |
interface fixes and tests
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 2e45e1d9..d54515d3 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) + |