Skip to content

Commit 2b64c8d

Browse files
committed
add new woff and woff2 font model tests
1 parent e09b630 commit 2b64c8d

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

tests/test_models_fontmodel.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
from pathlib import Path
22

3-
from PyQt5.QtWidgets import QTableView
4-
53
from slice.models import FontModel
64

75
#
@@ -13,6 +11,14 @@ def get_font_path_vf():
1311
return Path("tests/assets/fonts/Recursive-VF.subset.ttf").resolve()
1412

1513

14+
def get_font_path_vf_woff():
15+
return Path("tests/assets/fonts/Recursive-VF.subset.woff").resolve()
16+
17+
18+
def get_font_path_vf_woff2():
19+
return Path("tests/assets/fonts/Recursive-VF.subset.woff2").resolve()
20+
21+
1622
def get_font_string_vf():
1723
return str(Path("tests/assets/fonts/Recursive-VF.subset.ttf").resolve())
1824

@@ -49,6 +55,16 @@ def test_font_model_is_variable_font_true_with_path():
4955
assert fm.is_variable_font() is True
5056

5157

58+
def test_font_model_is_variable_font_true_with_path_woff():
59+
fm = FontModel(get_font_path_vf_woff())
60+
assert fm.is_variable_font() is True
61+
62+
63+
def test_font_model_is_variable_font_true_with_path_woff2():
64+
fm = FontModel(get_font_path_vf_woff2())
65+
assert fm.is_variable_font() is True
66+
67+
5268
def test_font_model_is_variable_font_false_with_path():
5369
fm = FontModel(get_font_path_static())
5470
assert fm.is_variable_font() is False

0 commit comments

Comments
 (0)