aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2010-09-28 18:24:11 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2010-09-29 15:44:13 -0300
commit169d0f8147316f9c1b287953f03113dca997a37b (patch)
treeac1108129b1aa96882c63bed32a406a86baebeae
parenteabb9d37a78d1c584fe7e70928f0e820bd6e0afc (diff)
Add test to check iterability of QPolygonF.
-rw-r--r--tests/QtGui/CMakeLists.txt1
-rw-r--r--tests/QtGui/qpolygonf_test.py22
2 files changed, 23 insertions, 0 deletions
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()