aboutsummaryrefslogtreecommitdiffstats
path: root/tests/QtGui/bug_617.py
blob: c5cffb826e06ae35ace5fd108df737eb4fb4ace2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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 PySide.QtCore.QEvent.Type.#out of bounds# (999)>')

if __name__ == "__main__":
   unittest.main()