[pygobject] test_properties: Test accessing a property from a superclass
- From: Martin Pitt <martinpitt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygobject] test_properties: Test accessing a property from a superclass
- Date: Mon, 17 Sep 2012 07:42:23 +0000 (UTC)
commit a047f61f26d9c78b82d22948199313e5a389e918
Author: Martin Pitt <martinpitt gnome org>
Date: Mon Sep 17 09:41:24 2012 +0200
test_properties: Test accessing a property from a superclass
We already cover accessing the superclass' property if that was defined in
Python. Add a corresponding test case for a property defined in C.
See https://bugzilla.gnome.org/show_bug.cgi?id=684058
tests/test_properties.py | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/tests/test_properties.py b/tests/test_properties.py
index 1b2f707..405375d 100644
--- a/tests/test_properties.py
+++ b/tests/test_properties.py
@@ -610,6 +610,18 @@ class TestProperty(unittest.TestCase):
b.prop1 = 20
self.assertEqual(b.prop1, 20)
+ def test_property_subclass_c(self):
+ class A(GIMarshallingTests.PropertiesObject):
+ prop1 = GObject.Property(type=int)
+
+ a = A()
+ a.prop1 = 10
+ self.assertEqual(a.prop1, 10)
+
+ # also has parent properties
+ a.props.some_int = 20
+ self.assertEqual(a.props.some_int, 20)
+
def test_property_subclass_custom_setter(self):
# test for #523352
class A(GObject.GObject):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]