mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-02-16 03:20:53 +03:00
26 lines
707 B
Python
26 lines
707 B
Python
from helper import unittest, PillowTestCase, hopper
|
|
from test_imageqt import PillowQPixmapTestCase
|
|
|
|
from PIL import ImageQt
|
|
|
|
if ImageQt.qt_is_installed:
|
|
from PIL.ImageQt import QPixmap
|
|
|
|
|
|
class TestToQPixmap(PillowQPixmapTestCase, PillowTestCase):
|
|
|
|
def test_sanity(self):
|
|
QPixmap('Tests/images/hopper.ppm').save(
|
|
'/tmp/hopper_RGB_qpixmap_file.png')
|
|
for mode in ('1', 'RGB', 'RGBA', 'L', 'P'):
|
|
data = ImageQt.toqpixmap(hopper(mode))
|
|
data.save('/tmp/hopper_{}_qpixmap.png'.format(mode))
|
|
self.assertTrue(isinstance(data, QPixmap))
|
|
self.assertFalse(data.isNull())
|
|
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|
|
|
|
# End of file
|