aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAnderson Lizardo <anderson.lizardo@openbossa.org>2010-02-18 15:10:36 -0400
committerMarcelo Lira <marcelo.lira@openbossa.org>2010-02-18 18:47:39 -0300
commit0f2681523a65b34f6b1317ce48ceb1e55ed907b9 (patch)
treeec9e64cd2e6c20beb410d025af7f6ae8d75b9a26 /tests
parent7edc6b4ef1fb8ce2fd4decf10c084526509ce3c2 (diff)
Add tests/qtgui/qradialgradient_test.py
Test various combinations of implicit qreal <-> int conversions and QPointF handling. Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/qtgui/qradialgradient_test.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/qtgui/qradialgradient_test.py b/tests/qtgui/qradialgradient_test.py
new file mode 100644
index 000000000..0c582c341
--- /dev/null
+++ b/tests/qtgui/qradialgradient_test.py
@@ -0,0 +1,29 @@
+import unittest
+
+from PySide.QtGui import QRadialGradient
+from PySide.QtCore import QPointF
+
+class QRadialGradientConstructor(unittest.TestCase):
+ def _compare(self, qptf, tpl):
+ self.assertEqual((qptf.x(), qptf.y()), tpl)
+
+ def _assertValues(self, grad):
+ self._compare(grad.center(), (1.0, 2.0))
+ self._compare(grad.focalPoint(), (3.0, 4.0))
+ self.assertEqual(grad.radius(), 5.0)
+
+ def testAllInt(self):
+ grad = QRadialGradient(1, 2, 5, 3, 4)
+ self._assertValues(grad)
+
+ def testQPointF(self):
+ grad = QRadialGradient(QPointF(1, 2), 5, QPointF(3, 4))
+ self._assertValues(grad)
+
+ def testSetQPointF(self):
+ grad = QRadialGradient()
+ grad.setCenter(QPointF(1, 2))
+ self._compare(grad.center(), (1.0, 2.0))
+
+if __name__ == '__main__':
+ unittest.main()