Added all original pyside unit tests to the shiboken version.
This commit is contained in:
parent
aa12538d63
commit
9af36fbb64
160 changed files with 6616 additions and 12 deletions
39
tests/qtgui/qvariant_test.py
Normal file
39
tests/qtgui/qvariant_test.py
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
'''Test cases for QVariant with QtGui types'''
|
||||
|
||||
import unittest
|
||||
|
||||
from PySide.QtCore import *
|
||||
from PySide.QtGui import *
|
||||
|
||||
class Dummy(object):
|
||||
pass
|
||||
|
||||
class QVariantTypeName(unittest.TestCase):
|
||||
def testQPen(self):
|
||||
obj = QVariant(QPen(Qt.red))
|
||||
self.assertEqual('QPen', obj.typeName())
|
||||
|
||||
def testQColor(self):
|
||||
obj = QVariant(QColor(Qt.red))
|
||||
self.assertEqual('QColor', obj.typeName())
|
||||
|
||||
def testGlobalColor(self):
|
||||
obj = QVariant(Qt.red)
|
||||
# XXX: PyQt4 returns int instead of QColor like the C++ version
|
||||
self.assertEqual('QColor', obj.typeName())
|
||||
|
||||
def testEnums(self):
|
||||
obj = QVariant(Qt.SolidLine)
|
||||
self.assertEqual('int', obj.typeName())
|
||||
|
||||
class QVariantQColorImplicitlyConvertion(unittest.TestCase):
|
||||
def testConversions(self):
|
||||
c1 = QColor(0, 0, 0)
|
||||
v = QVariant(c1)
|
||||
c2 = QColor(v)
|
||||
self.assertEqual(c1, c2)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Loading…
Add table
Add a link
Reference in a new issue