aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLauro Neto <lauro.neto@openbossa.org>2010-02-02 15:48:05 -0300
committerHugo Lima <hugo.lima@openbossa.org>2010-02-03 19:00:59 -0200
commit6e33903fe2b45e8d9e5b631e8383d89d1078ec83 (patch)
treef925dd6d693b7091bd486affa50f51906be1b1d8 /tests
parentecf529ce6a0d75f4694168f62e83d49230ed27eb (diff)
Adding extra tests to QVariant
Diffstat (limited to 'tests')
-rw-r--r--tests/qtcore/qobject_property_test.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/qtcore/qobject_property_test.py b/tests/qtcore/qobject_property_test.py
index ecf101906..33df2ac9b 100644
--- a/tests/qtcore/qobject_property_test.py
+++ b/tests/qtcore/qobject_property_test.py
@@ -3,7 +3,7 @@
import unittest
-from PySide.QtCore import QObject, QVariant
+from PySide.QtCore import QObject, QVariant, QString
class PropertyCase(unittest.TestCase):
'''Test case for QObject properties'''
@@ -41,6 +41,23 @@ class PropertyCase(unittest.TestCase):
# QVariant.toInt has a bool* arg in C++, so returns a tuple
self.assertEqual(obj.property('dummy').toInt(), (42, True))
+ def testQStringProperty(self):
+ obj = QObject()
+ self.assert_(not obj.setProperty('dummy', QString('data')))
+ prop = obj.property('dummy')
+
+ self.assert_(isinstance(prop, QVariant))
+ self.assert_(prop.isValid())
+ self.assertEqual(obj.property('dummy').toString(), QString('data'))
+
+ def testImplicitQVariantProperty(self):
+ obj = QObject()
+ self.assert_(not obj.setProperty('dummy', 'data'))
+ prop = obj.property('dummy')
+
+ self.assert_(isinstance(prop, QVariant))
+ self.assert_(prop.isValid())
+ self.assertEqual(obj.property('dummy').toString(), 'data')
def testInvalidProperty(self):
#QObject.property() for invalid properties