From 169d0f8147316f9c1b287953f03113dca997a37b Mon Sep 17 00:00:00 2001 From: Hugo Parente Lima Date: Tue, 28 Sep 2010 18:24:11 -0300 Subject: Add test to check iterability of QPolygonF. --- tests/QtGui/CMakeLists.txt | 1 + tests/QtGui/qpolygonf_test.py | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 tests/QtGui/qpolygonf_test.py diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt index a26c1f615..c8db7a2b4 100644 --- a/tests/QtGui/CMakeLists.txt +++ b/tests/QtGui/CMakeLists.txt @@ -48,6 +48,7 @@ PYSIDE_TEST(qobject_mi_test.py) PYSIDE_TEST(qpainter_test.py) PYSIDE_TEST(qpen_test.py) PYSIDE_TEST(qpixmap_test.py) +PYSIDE_TEST(qpolygonf_test.py) PYSIDE_TEST(qpushbutton_test.py) PYSIDE_TEST(qradialgradient_test.py) PYSIDE_TEST(qregion_test.py) diff --git a/tests/QtGui/qpolygonf_test.py b/tests/QtGui/qpolygonf_test.py new file mode 100644 index 000000000..83e643c36 --- /dev/null +++ b/tests/QtGui/qpolygonf_test.py @@ -0,0 +1,22 @@ + +import unittest +from PySide.QtCore import * +from PySide.QtGui import * + +class QPolygonFNotIterableTest(unittest.TestCase): + """Test if a QPolygonF is iterable""" + def testIt(self): + p = QPolygonF(4) + self.assertEqual(len(p), 4) + + for i in range(0, 4): + p[i] = QPointF(float(i), float(i)) + + i = 0 + for point in p: + self.assertEqual(int(point.x()), i) + self.assertEqual(int(point.y()), i) + i += 1; + +if __name__ == '__main__': + unittest.main() -- cgit v1.2.3