Created unit test for bug #897.
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org>
Luciano Wolf <luciano.wolf@openbossa.org>
This commit is contained in:
parent
930d1f279a
commit
10f88e23f7
1 changed files with 14 additions and 0 deletions
|
|
@ -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.'''
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue