We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 5187b54 + 5ce8929 commit c7ed097Copy full SHA for c7ed097
Tests/test_font_bdf.py
@@ -1,5 +1,7 @@
1
from __future__ import annotations
2
3
+import io
4
+
5
import pytest
6
7
from PIL import BdfFontFile, FontFile
@@ -8,13 +10,20 @@
8
10
9
11
12
def test_sanity() -> None:
- with open(filename, "rb") as test_file:
- font = BdfFontFile.BdfFontFile(test_file)
13
+ with open(filename, "rb") as fp:
14
+ font = BdfFontFile.BdfFontFile(fp)
15
16
assert isinstance(font, FontFile.FontFile)
17
assert len([_f for _f in font.glyph if _f]) == 190
18
19
20
+def test_zero_width_chars() -> None:
21
22
+ data = fp.read()
23
+ data = data[:2650] + b"\x00\x00" + data[2652:]
24
+ BdfFontFile.BdfFontFile(io.BytesIO(data))
25
26
27
def test_invalid_file() -> None:
28
with open("Tests/images/flower.jpg", "rb") as fp:
29
with pytest.raises(SyntaxError):
0 commit comments