mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-06-19 12:33:16 +03:00
Test that subsequent compile() calls do not change anything
This commit is contained in:
parent
769a14dca5
commit
ae7c4920c9
|
@ -4,7 +4,20 @@ from pathlib import Path
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from PIL import FontFile
|
from PIL import FontFile, Image
|
||||||
|
|
||||||
|
|
||||||
|
def test_compile() -> None:
|
||||||
|
font = FontFile.FontFile()
|
||||||
|
font.glyph[0] = ((0, 0), (0, 0, 0, 0), (0, 0, 0, 1), Image.new("L", (0, 0)))
|
||||||
|
font.compile()
|
||||||
|
assert font.ysize == 1
|
||||||
|
|
||||||
|
font.ysize = 2
|
||||||
|
font.compile()
|
||||||
|
|
||||||
|
# Assert that compiling again did not change anything
|
||||||
|
assert font.ysize == 2
|
||||||
|
|
||||||
|
|
||||||
def test_save(tmp_path: Path) -> None:
|
def test_save(tmp_path: Path) -> None:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user