Add tests for various external DLL based modules in pillow

This commit is contained in:
Kovid Goyal 2023-04-21 13:41:40 +05:30
parent ef8a6f05ac
commit e4eae39a5f
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -397,6 +397,22 @@ class BuildTest(unittest.TestCase):
except ImportError:
from PIL import _imaging, _imagingft, _imagingmath
_imaging, _imagingmath, _imagingft
from PIL import features
from io import StringIO
out = StringIO()
features.pilinfo(out=out, supported_formats=False)
out = out.getvalue()
for line in '''\
--- PIL CORE support ok
--- FREETYPE2 support ok
--- WEBP support ok
--- WEBP Transparency support ok
--- WEBPMUX support ok
--- WEBP Animation support ok
--- JPEG support ok
--- ZLIB (PNG/ZIP) support ok
'''.splitlines():
self.assertIn(line.strip(), out)
i = Image.open(I('lt.png', allow_user_override=False))
self.assertGreaterEqual(i.size, (20, 20))
i = Image.open(P('catalog/DefaultCover.jpg', allow_user_override=False))