Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
m4rc1e committed Jan 23, 2024
1 parent 7e15891 commit f1b7519
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/test_fix.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,3 +274,14 @@ def test_fix_colr_v1_font(colr_v1_font):
colr_v1_font["COLR"].version = 1
fixed = fix_colr_font(colr_v1_font)
assert "SVG " in fixed


def test_ofl_license_strings(static_font):
from gftools.fix import fix_license_strings
from gftools.constants import OFL_LICENSE_INFO, OFL_LICENSE_URL

for id in (13, 14):
assert "sil.org" in static_font["name"].getName(id, 3, 1, 0x409).toUnicode()

Check failure

Code scanning / CodeQL

Incomplete URL substring sanitization High test

The string
sil.org
may be at an arbitrary position in the sanitized URL.
fix_license_strings(static_font)
for id in (13, 14):
assert "openfontlicense.org" in static_font["name"].getName(13, 3, 1, 0x409).toUnicode()

Check failure

Code scanning / CodeQL

Incomplete URL substring sanitization High test

The string
openfontlicense.org
may be at an arbitrary position in the sanitized URL.

0 comments on commit f1b7519

Please # to comment.