Adding test for QColor(QRgb)
This commit is contained in:
parent
8bc7aa50c6
commit
7256827c89
1 changed files with 14 additions and 0 deletions
|
|
@ -2,6 +2,7 @@
|
||||||
import unittest
|
import unittest
|
||||||
import colorsys
|
import colorsys
|
||||||
|
|
||||||
|
from PySide.QtCore import Qt
|
||||||
from PySide.QtGui import QColor
|
from PySide.QtGui import QColor
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -45,5 +46,18 @@ class QColorGetTest(unittest.TestCase):
|
||||||
self.assert_(x - y < 1/10000.0)
|
self.assert_(x - y < 1/10000.0)
|
||||||
|
|
||||||
|
|
||||||
|
class QColorQRgbConstructor(unittest.TestCase):
|
||||||
|
'''QColor(QRgb) constructor'''
|
||||||
|
# Affected by bug #170 - QColor(QVariant) coming before QColor(uint)
|
||||||
|
# in overload sorting
|
||||||
|
|
||||||
|
def testBasic(self):
|
||||||
|
'''QColor(QRgb)'''
|
||||||
|
color = QColor(255, 0, 0)
|
||||||
|
#QRgb format #AARRGGBB
|
||||||
|
rgb = 0x00FF0000
|
||||||
|
self.assertEqual(QColor(rgb), color)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue