mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 18:06:18 +03:00
20 lines
472 B
Python
20 lines
472 B
Python
import pytest
|
|
|
|
from PIL import BdfFontFile, FontFile
|
|
|
|
filename = "Tests/images/courB08.bdf"
|
|
|
|
|
|
def test_sanity():
|
|
with open(filename, "rb") as test_file:
|
|
font = BdfFontFile.BdfFontFile(test_file)
|
|
|
|
assert isinstance(font, FontFile.FontFile)
|
|
assert len([_f for _f in font.glyph if _f]) == 190
|
|
|
|
|
|
def test_invalid_file():
|
|
with open("Tests/images/flower.jpg", "rb") as fp:
|
|
with pytest.raises(SyntaxError):
|
|
BdfFontFile.BdfFontFile(fp)
|