aboutsummaryrefslogtreecommitdiffstats
path: root/tests/QtGui/bug_617.py
blob: fc8952f5440076fcf278f0a729da46ef40f620bf (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()), 'PySide.QtCore.QEvent.Type(999)')

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