From 7eb5694e17cbbf8c167ad3b483b4c7d6c89a5650 Mon Sep 17 00:00:00 2001 From: Renato Filho Date: Tue, 28 Jun 2011 11:40:33 -0300 Subject: Created unit test for bug #897. Reviewer: Marcelo Lira Luciano Wolf --- tests/QtCore/qobject_property_test.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests') 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.''' -- cgit v1.2.3