aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPaulo Alcantara <paulo.alcantara@openbossa.org>2011-05-10 16:31:42 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:54:22 -0300
commitad023b3cb5b2bcb1598983bccba0a49c56b9d58e (patch)
treefb21efa1ed72ab136ae95236736c2186b589f0d3 /tests
parent6545eb21f52545f2319d853a827a1122dfbac6cf (diff)
Create unit tests for bug #606
Signed-off-by: Paulo Alcantara <paulo.alcantara@openbossa.org> Reviewer: Lauro Moura <lauro.neto@openbossa.org> Marcelo Lira <marcelo.lira@openbossa.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/QtCore/CMakeLists.txt1
-rw-r--r--tests/QtCore/bug_606.py34
-rw-r--r--tests/QtGui/CMakeLists.txt1
-rw-r--r--tests/QtGui/bug_606.py26
4 files changed, 62 insertions, 0 deletions
diff --git a/tests/QtCore/CMakeLists.txt b/tests/QtCore/CMakeLists.txt
index cea782c3d..623326321 100644
--- a/tests/QtCore/CMakeLists.txt
+++ b/tests/QtCore/CMakeLists.txt
@@ -5,6 +5,7 @@ PYSIDE_TEST(bug_428.py)
PYSIDE_TEST(bug_462.py)
PYSIDE_TEST(bug_505.py)
PYSIDE_TEST(bug_515.py)
+PYSIDE_TEST(bug_606.py)
PYSIDE_TEST(bug_656.py)
PYSIDE_TEST(bug_699.py)
PYSIDE_TEST(bug_706.py)
diff --git a/tests/QtCore/bug_606.py b/tests/QtCore/bug_606.py
new file mode 100644
index 000000000..219b8d99b
--- /dev/null
+++ b/tests/QtCore/bug_606.py
@@ -0,0 +1,34 @@
+import unittest
+
+import PySide
+from PySide.QtCore import QPoint, QPointF
+from PySide.QtCore import QLine, QLineF
+from PySide.QtCore import QSize, QSizeF
+
+class testCases(unittest.TestCase):
+ def testQPointToTuple(self):
+ p = QPoint(1, 2)
+ self.assertEqual((1, 2), p.toTuple())
+
+ def testQPointFToTuple(self):
+ p = QPointF(1, 2)
+ self.assertEqual((1, 2), p.toTuple())
+
+ def testQLineToTuple(self):
+ l = QLine(1, 2, 3, 4)
+ self.assertEqual((1, 2, 3, 4), l.toTuple())
+
+ def testQLineFToTuple(self):
+ l = QLineF(1, 2, 3, 4)
+ self.assertEqual((1, 2, 3, 4), l.toTuple())
+
+ def testQSizeToTuple(self):
+ s = QSize(1, 2)
+ self.assertEqual((1, 2), s.toTuple())
+
+ def testQSizeFToTuple(self):
+ s = QSizeF(1, 2)
+ self.assertEqual((1, 2), s.toTuple())
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt
index 97eb9c33d..338f2e8f2 100644
--- a/tests/QtGui/CMakeLists.txt
+++ b/tests/QtGui/CMakeLists.txt
@@ -30,6 +30,7 @@ PYSIDE_TEST(bug_575.py)
PYSIDE_TEST(bug_576.py)
PYSIDE_TEST(bug_585.py)
PYSIDE_TEST(bug_589.py)
+PYSIDE_TEST(bug_606.py)
PYSIDE_TEST(bug_617.py)
PYSIDE_TEST(bug_635.py)
PYSIDE_TEST(bug_640.py)
diff --git a/tests/QtGui/bug_606.py b/tests/QtGui/bug_606.py
new file mode 100644
index 000000000..0fe1bde6e
--- /dev/null
+++ b/tests/QtGui/bug_606.py
@@ -0,0 +1,26 @@
+import unittest
+
+import PySide
+from PySide.QtGui import QVector2D, QVector3D, QVector4D
+from PySide.QtGui import QColor
+
+class testCases(unittest.TestCase):
+ def testQVector2DToTuple(self):
+ vec = QVector2D(1, 2)
+ self.assertEqual((1, 2), vec.toTuple())
+
+ def testQVector3DToTuple(self):
+ vec = QVector3D(1, 2, 3)
+ self.assertEqual((1, 2, 3), vec.toTuple())
+
+ def testQVector4DToTuple(self):
+ vec = QVector4D(1, 2, 3, 4)
+ self.assertEqual((1, 2, 3, 4), vec.toTuple())
+
+ def testQColorToTuple(self):
+ c = QColor(0, 0, 255)
+ c.setRgb(1, 2, 3)
+ self.assertEqual((1, 2, 3, 255), c.toTuple())
+
+if __name__ == '__main__':
+ unittest.main()