fix code-test for com.google.fonts/check/156
(issue
@@ -1986,13 +1986,15 @@ def test_check_156():
NameID.FULL_FONT_NAME,
NameID.POSTSCRIPT_NAME]
- # then we remove each mandatory entry
- # one by one:
- for mandatory in [mandatory_entries]:
+ # then we "remove" each mandatory entry one by one:
+ for mandatory in mandatory_entries:
+ ttFont = TTFont("data/test/cabin/Cabin-Regular.ttf")
for i, name in enumerate(ttFont['name'].names):
if name.nameID == mandatory:
- del ttFont['name'].names[i]
- print ("Test FAIL with a missing madatory (RIBBI) name entry...")
+ ttFont['name'].names[i].nameID = 0 # not really removing it, but replacing it
+ # by something else completely irrelevant
+ # for the purposes of this specific check
+ print (f"Test FAIL with a missing madatory (RIBBI) name entry (id={mandatory})...")
status, message = list(check(ttFont, style))[-1]
assert status == FAIL
@@ -2013,13 +2015,15 @@ def test_check_156():
NameID.TYPOGRAPHIC_FAMILY_NAME,
NameID.TYPOGRAPHIC_SUBFAMILY_NAME]
- # then we (again) remove each mandatory entry
- # one by one:
- for mandatory in [mandatory_entries]:
+ # then we (again) "remove" each mandatory entry one by one:
+ for mandatory in mandatory_entries:
+ ttFont = TTFont("data/test/merriweather/Merriweather-Black.ttf")
for i, name in enumerate(ttFont['name'].names):
- if name.nameID == mandatory:
- del ttFont['name'].names[i]
- print ("Test FAIL with a missing madatory (non-RIBBI) name entry...")
+ if name.nameID in mandatory_entries:
+ ttFont['name'].names[i].nameID = 0 # not really removing it, but replacing it
+ # by something else completely irrelevant
+ # for the purposes of this specific check
+ print ("Test FAIL with a missing madatory (non-RIBBI) name entry (id={mandatory})...")
status, message = list(check(ttFont, style))[-1]
assert status == FAIL
