import unittest

from helper import UsesQApplication
from PySide.QtGui import QPixmap
from PySide.QtCore import QVariant

#Only test if is possible create a QPixmap from a QVariant
class QPixmapTest(UsesQApplication):
    def testQVariantConstructor(self):
        pixmap = QPixmap()
        v = QVariant(pixmap)
        pixmap_copy = QPixmap(v)

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


import unittest

from helper import UsesQApplication
from PySide.QtGui import QPixmap
from PySide.QtCore import QVariant, QSize, QString

class QPixmapTest(UsesQApplication):
    def testQVariantConstructor(self):
        pixmap = QPixmap()
        v = QVariant(pixmap)
        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__':
    unittest.main()


Improve qpixmap test to support qstring and qsize arguments.
Improve qpixmap test to support qstring and qsize arguments.

Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>

  import unittest
  
  from helper import UsesQApplication
  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):
      def testQVariantConstructor(self):
          pixmap = QPixmap()
          v = QVariant(pixmap)
          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__':
      unittest.main()
  
  
Improve qpixmap test to support qstring and qsize arguments.
## Code Before:
import unittest

from helper import UsesQApplication
from PySide.QtGui import QPixmap
from PySide.QtCore import QVariant

#Only test if is possible create a QPixmap from a QVariant
class QPixmapTest(UsesQApplication):
    def testQVariantConstructor(self):
        pixmap = QPixmap()
        v = QVariant(pixmap)
        pixmap_copy = QPixmap(v)

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


## Instruction:
Improve qpixmap test to support qstring and qsize arguments.
## Code After:
import unittest

from helper import UsesQApplication
from PySide.QtGui import QPixmap
from PySide.QtCore import QVariant, QSize, QString

class QPixmapTest(UsesQApplication):
    def testQVariantConstructor(self):
        pixmap = QPixmap()
        v = QVariant(pixmap)
        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__':
    unittest.main()

