diff options
author | Hugo Parente Lima <hugo.pl@gmail.com> | 2010-09-28 18:24:11 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2010-09-29 15:44:13 -0300 |
commit | 169d0f8147316f9c1b287953f03113dca997a37b (patch) | |
tree | ac1108129b1aa96882c63bed32a406a86baebeae /tests/QtGui/qpolygonf_test.py | |
parent | eabb9d37a78d1c584fe7e70928f0e820bd6e0afc (diff) |
Add test to check iterability of QPolygonF.
Diffstat (limited to 'tests/QtGui/qpolygonf_test.py')
-rw-r--r-- | tests/QtGui/qpolygonf_test.py | 22 |
1 files changed, 22 insertions, 0 deletions
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() |