summaryrefslogtreecommitdiffstats
path: root/tests/test_interface.py
diff options
context:
space:
mode:
authorGustavo J. A. M. Carneiro <gjc@src.gnome.org>2006-08-27 12:02:33 +0000
committerGustavo J. A. M. Carneiro <gjc@src.gnome.org>2006-08-27 12:02:33 +0000
commitd05fccab23aef7fa4c406352552262782bf1066c (patch)
tree0e35f797d3aaacf586384e343120ea06f8ae5358 /tests/test_interface.py
parent3938273dfd085dc75f64ce44706cf508fd971099 (diff)
downloadpygobject-d05fccab23aef7fa4c406352552262782bf1066c.tar.gz
pygobject-d05fccab23aef7fa4c406352552262782bf1066c.tar.xz
pygobject-d05fccab23aef7fa4c406352552262782bf1066c.zip
interface fixes and tests
Diffstat (limited to 'tests/test_interface.py')
-rw-r--r--tests/test_interface.py30
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)
+