Fix generated property flags on metaobject.

Fixes bug #478

Reviewer: Luciano Wolf <luciano.wolf@openbossa.org>
          Marcelo Lira <marcelo.lira@openbossa.org>
This commit is contained in:
Renato Araujo Oliveira Filho 2010-11-21 18:08:46 -03:00
commit e12197e282
4 changed files with 52 additions and 30 deletions

View file

@ -188,6 +188,20 @@ class PropertyWithNotify(unittest.TestCase):
obj.myProperty = 10
self.assert_(self.called_)
class MetaPropertyTest(unittest.TestCase):
def testConstant(self):
obj = MyObject()
mo = obj.metaObject()
self.assertEqual(mo.propertyCount(), 2)
p = mo.property(1)
self.assertTrue(p.isConstant())
obj = MyObjectWithNotifyProperty()
mo = obj.metaObject()
self.assertEqual(mo.propertyCount(), 2)
p = mo.property(1)
self.assertFalsee(p.isConstant())
if __name__ == '__main__':
unittest.main()