2023-12-21 14:13:31 +03:00
|
|
|
from __future__ import annotations
|
2024-01-20 14:23:03 +03:00
|
|
|
|
2023-01-01 05:18:30 +03:00
|
|
|
import sys
|
|
|
|
|
|
|
|
from PIL import features
|
|
|
|
|
|
|
|
|
2024-01-19 13:50:27 +03:00
|
|
|
def test_wheel_modules() -> None:
|
2023-01-01 05:18:30 +03:00
|
|
|
expected_modules = {"pil", "tkinter", "freetype2", "littlecms2", "webp"}
|
|
|
|
|
|
|
|
# tkinter is not available in cibuildwheel installed CPython on Windows
|
2023-11-30 21:08:35 +03:00
|
|
|
try:
|
|
|
|
import tkinter
|
|
|
|
|
|
|
|
assert tkinter
|
|
|
|
except ImportError:
|
2023-01-01 05:18:30 +03:00
|
|
|
expected_modules.remove("tkinter")
|
|
|
|
|
|
|
|
assert set(features.get_supported_modules()) == expected_modules
|
|
|
|
|
|
|
|
|
2024-01-19 13:50:27 +03:00
|
|
|
def test_wheel_codecs() -> None:
|
2023-01-01 05:18:30 +03:00
|
|
|
expected_codecs = {"jpg", "jpg_2000", "zlib", "libtiff"}
|
|
|
|
|
|
|
|
assert set(features.get_supported_codecs()) == expected_codecs
|
|
|
|
|
|
|
|
|
2024-01-19 13:50:27 +03:00
|
|
|
def test_wheel_features() -> None:
|
2023-01-01 05:18:30 +03:00
|
|
|
expected_features = {
|
|
|
|
"raqm",
|
|
|
|
"fribidi",
|
|
|
|
"harfbuzz",
|
|
|
|
"libjpeg_turbo",
|
|
|
|
"xcb",
|
|
|
|
}
|
|
|
|
|
|
|
|
if sys.platform == "win32":
|
|
|
|
expected_features.remove("xcb")
|
|
|
|
|
|
|
|
assert set(features.get_supported_features()) == expected_features
|