aboutsummaryrefslogtreecommitdiffstats
path: root/tests/QtCore
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2011-06-28 11:40:33 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:54:30 -0300
commit7eb5694e17cbbf8c167ad3b483b4c7d6c89a5650 (patch)
tree9a9b3a03db60d14ad580c2fda839b0e7dd969ca3 /tests/QtCore
parentb385e0c3edd0d9e99665cebbd8ee37055594d838 (diff)
Created unit test for bug #897.
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'tests/QtCore')
-rw-r--r--tests/QtCore/qobject_property_test.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/QtCore/qobject_property_test.py b/tests/QtCore/qobject_property_test.py
index bc38dbb18..721450582 100644
--- a/tests/QtCore/qobject_property_test.py
+++ b/tests/QtCore/qobject_property_test.py
@@ -36,6 +36,12 @@ class MyObject(QObject):
pp = Property(int, readPP, constant=True)
+class MySubObject(MyObject):
+ pass
+
+class MyMultipleObject(MyObject, object):
+ pass
+
class MyObjectWithNotifyProperty(QObject):
def __init__(self, parent=None):
QObject.__init__(self, parent)
@@ -137,6 +143,14 @@ class PropertyCase(unittest.TestCase):
self.assertFalse(obj.property('rect') is rect)
self.assertEqual(obj.property('rect'), rect)
+ def testSubClassProperty(self):
+ o = MyObject()
+ self.assertEqual(o.property('pp'), 42)
+ so = MySubObject()
+ self.assertEqual(so.property('pp'), 42)
+ mo = MyMultipleObject()
+ self.assertEqual(mo.property('pp'), 42)
+
class PropertyWithConstructorCase(unittest.TestCase):
'''Test case for QObject properties set using named arguments in the constructor.'''