[pygobject] test_unknown.py: Check property interface
- From: Martin Pitt <martinpitt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygobject] test_unknown.py: Check property interface
- Date: Wed, 14 Nov 2012 06:10:38 +0000 (UTC)
commit 614cc9594cb34d92a6d4b00773427d4fb023c65e
Author: Martin Pitt <martinpitt gnome org>
Date: Wed Nov 14 07:09:58 2012 +0100
test_unknown.py: Check property interface
NB that the property implementation in test-unknown.c does not actually do
anything, we just want to assert that the properties are properly registered.
tests/test_unknown.py | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/tests/test_unknown.py b/tests/test_unknown.py
index ca5d460..20f3005 100644
--- a/tests/test_unknown.py
+++ b/tests/test_unknown.py
@@ -16,3 +16,13 @@ class TestUnknown(unittest.TestCase):
TestUnknown = GObject.new(TestUnknownGType).__class__
assert isinstance(obj, testhelper.Interface)
assert isinstance(obj, TestUnknown)
+
+ def test_property(self):
+ obj = testhelper.get_unknown()
+ self.assertEqual(obj.get_property('some-property'), None)
+ obj.set_property('some-property', 'foo')
+
+ def test_unknown_property(self):
+ obj = testhelper.get_unknown()
+ self.assertRaises(TypeError, obj.get_property, 'unknown')
+ self.assertRaises(TypeError, obj.set_property, 'unknown', '1')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]