From f3bcaf31a85dbd07ef5fcb47fe582dc3ecedf8b1 Mon Sep 17 00:00:00 2001 From: Renato Araujo Oliveira Filho Date: Fri, 28 Jan 2011 15:58:21 -0300 Subject: Created unit test for bug #617. Reviewer: Luciano Wolf Marcelo Lira --- tests/QtGui/CMakeLists.txt | 1 + tests/QtGui/bug_617.py | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 tests/QtGui/bug_617.py 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()), '') + +if __name__ == "__main__": + unittest.main() -- cgit v1.2.3