Improve qpixmap test to support qstring and qsize arguments.
Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
This commit is contained in:
parent
97dd193838
commit
aa2a2a5703
1 changed files with 8 additions and 2 deletions
|
|
@ -2,15 +2,21 @@ import unittest
|
||||||
|
|
||||||
from helper import UsesQApplication
|
from helper import UsesQApplication
|
||||||
from PySide.QtGui import QPixmap
|
from PySide.QtGui import QPixmap
|
||||||
from PySide.QtCore import QVariant
|
from PySide.QtCore import QVariant, QSize, QString
|
||||||
|
|
||||||
#Only test if is possible create a QPixmap from a QVariant
|
|
||||||
class QPixmapTest(UsesQApplication):
|
class QPixmapTest(UsesQApplication):
|
||||||
def testQVariantConstructor(self):
|
def testQVariantConstructor(self):
|
||||||
pixmap = QPixmap()
|
pixmap = QPixmap()
|
||||||
v = QVariant(pixmap)
|
v = QVariant(pixmap)
|
||||||
pixmap_copy = QPixmap(v)
|
pixmap_copy = QPixmap(v)
|
||||||
|
|
||||||
|
def testQSizeConstructor(self):
|
||||||
|
pixmap = QPixmap(QSize(10,20))
|
||||||
|
self.assert_(pixmap.size().height(), 20)
|
||||||
|
|
||||||
|
def testQStringConstructor(self):
|
||||||
|
pixmap = QPixmap(QString("Testing!"))
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue