test FAIL "invalid-entry" on check/158
(issue
@@ -2116,14 +2116,18 @@ def test_check_158():
familyname_with_spaces(familyname(filename))))[-1]
assert status == PASS
- # TODO:
# - FAIL, "invalid-entry" - "Font should not have a certain name table entry."
- #filename = "data/test/something...ttf"
- #print (f"Test FAIL 'invalid-entry' with filename='{filename}'...")
- #status, message = list(check(TTFont(filename),
- # style_with_spaces(filename),
- # familyname_with_spaces(familyname(filename))))[-1]
- #assert status == FAIL and message == "invalid-entry"
+ filename = "data/test/montserrat/Montserrat-ThinItalic.ttf"
+ print ("Test FAIL 'invalid-entry'...")
+ ttFont = TTFont(filename)
+ # We setup a bad entry:
+ ttFont["name"].names[0].nameID = NameID.FONT_SUBFAMILY_NAME
+ ttFont["name"].names[0].platformID = PlatformID.CUSTOM
+ # And this should now FAIL:
+ status, message = list(check(ttFont,
+ style_with_spaces(filename),
+ familyname_with_spaces(familyname(filename))))[-1]
+ assert status == FAIL and message.code == "invalid-entry"
# TODO:
# - FAIL, "bad-familyname" - "Bad familyname value on a FONT_SUBFAMILY_NAME entry."
@@ -2132,7 +2136,7 @@ def test_check_158():
#status, message = list(check(TTFont(filename),
# style_with_spaces(filename),
# familyname_with_spaces(familyname(filename))))[-1]
- #assert status == FAIL and message == "bad-familyname"
+ #assert status == FAIL and message.code == "bad-familyname"
def test_check_159():
