diff options
author | Anderson Lizardo <anderson.lizardo@openbossa.org> | 2010-02-18 15:10:36 -0400 |
---|---|---|
committer | Marcelo Lira <marcelo.lira@openbossa.org> | 2010-02-18 18:47:39 -0300 |
commit | 0f2681523a65b34f6b1317ce48ceb1e55ed907b9 (patch) | |
tree | ec9e64cd2e6c20beb410d025af7f6ae8d75b9a26 /tests | |
parent | 7edc6b4ef1fb8ce2fd4decf10c084526509ce3c2 (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.py | 29 |
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() |