aboutsummaryrefslogtreecommitdiffstats
path: root/tests/QtGui
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/QtGui
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/QtGui')
-rw-r--r--tests/QtGui/CMakeLists.txt1
-rw-r--r--tests/QtGui/bug_606.py26
2 files changed, 27 insertions, 0 deletions
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()