aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRenato Araujo Oliveira Filho <renato.filho@openbossa.org>2011-01-28 15:58:21 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:53:50 -0300
commitf3bcaf31a85dbd07ef5fcb47fe582dc3ecedf8b1 (patch)
tree0c50228a48340b1e6e50231b7ad0932a699bf633 /tests
parent6c3258cc03c3069231c904f3d0b4b59eaafb2074 (diff)
Created unit test for bug #617.
Reviewer: Luciano Wolf <luciano.wolf@openbossa.org> Marcelo Lira <marcelo.lira@openbossa.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/QtGui/CMakeLists.txt1
-rw-r--r--tests/QtGui/bug_617.py21
2 files changed, 22 insertions, 0 deletions
diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt
index b108921f0..1cc3696f5 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_617.py)
PYSIDE_TEST(bug_640.py)
PYSIDE_TEST(customproxywidget_test.py)
PYSIDE_TEST(deepcopy_test.py)
diff --git a/tests/QtGui/bug_617.py b/tests/QtGui/bug_617.py
new file mode 100644
index 000000000..0da51162d
--- /dev/null
+++ b/tests/QtGui/bug_617.py
@@ -0,0 +1,21 @@
+from PySide.QtCore import QEvent
+from PySide.QtGui import QColor
+import unittest
+
+class MyEvent(QEvent):
+ def __init__(self):
+ QEvent.__init__(self, QEvent.Type(999))
+
+
+class Bug617(unittest.TestCase):
+ def testRepr(self):
+ c = QColor.fromRgb(1, 2, 3, 4)
+ s = c.spec()
+ self.assertEqual(repr(s), repr(QColor.Rgb))
+
+ def testOutOfBounds(self):
+ e = MyEvent()
+ self.assertEqual(repr(e.type()), '<enum-item Type.#out of bounds# (999)>')
+
+if __name__ == "__main__":
+ unittest.main()