@@ -2396,53 +2396,52 @@ def test_check_fvar_instances__whats_going_on_here(check): # TODO: REVIEW THIS.
2396
2396
assert_PASS (check (ttFont ), "with a good font..." )
2397
2397
2398
2398
2399
- @pytest .mark .skip ("Check not ported yet." )
2400
2399
@check_id ("googlefonts/family/italics_have_roman_counterparts" )
2401
2400
def test_check_family_italics_have_roman_counterparts (check ):
2402
2401
"""Ensure Italic styles have Roman counterparts."""
2403
2402
2404
- # The path used here, "some-crazy.path/", is meant to ensure
2405
- # that the parsing code does not get lost when trying to
2406
- # extract the style of a font file.
2407
2403
fonts = [
2408
- "some-crazy.path/ merriweather/Merriweather-BlackItalic.ttf" ,
2409
- "some-crazy.path/ merriweather/Merriweather-Black.ttf" ,
2410
- "some-crazy.path/ merriweather/Merriweather-BoldItalic.ttf" ,
2411
- "some-crazy.path/ merriweather/Merriweather-Bold.ttf" ,
2412
- "some-crazy.path/ merriweather/Merriweather-Italic.ttf" ,
2413
- "some-crazy.path/ merriweather/Merriweather-LightItalic.ttf" ,
2414
- "some-crazy.path/ merriweather/Merriweather-Light.ttf" ,
2415
- "some-crazy.path/ merriweather/Merriweather-Regular.ttf" ,
2404
+ TEST_FILE ( " merriweather/Merriweather-BlackItalic.ttf") ,
2405
+ TEST_FILE ( " merriweather/Merriweather-Black.ttf") ,
2406
+ TEST_FILE ( " merriweather/Merriweather-BoldItalic.ttf") ,
2407
+ TEST_FILE ( " merriweather/Merriweather-Bold.ttf") ,
2408
+ TEST_FILE ( " merriweather/Merriweather-Italic.ttf") ,
2409
+ TEST_FILE ( " merriweather/Merriweather-LightItalic.ttf") ,
2410
+ TEST_FILE ( " merriweather/Merriweather-Light.ttf") ,
2411
+ TEST_FILE ( " merriweather/Merriweather-Regular.ttf") ,
2416
2412
]
2417
2413
2418
- assert_PASS (check ([ MockFont ( file = font ) for font in fonts ] ), "with a good family..." )
2414
+ assert_PASS (check (fonts ), "with a good family..." )
2419
2415
2420
2416
fonts .pop (- 1 ) # remove the last one, which is the Regular
2421
- assert "some-crazy.path/merriweather/Merriweather-Regular.ttf" not in fonts
2422
- assert "some-crazy.path/merriweather/Merriweather-Italic.ttf" in fonts
2423
2417
assert_results_contain (
2424
2418
check (fonts ),
2425
2419
FAIL ,
2426
2420
"missing-roman" ,
2427
2421
"with a family that has an Italic but lacks a Regular." ,
2428
2422
)
2429
2423
2430
- fonts .append ("some-crazy.path/merriweather/MerriweatherItalic.ttf" )
2424
+ shutil .copy (
2425
+ TEST_FILE ("merriweather/Merriweather-Italic.ttf" ),
2426
+ TEST_FILE ("merriweather/MerriweatherItalic.ttf" ),
2427
+ )
2428
+ fonts .append (TEST_FILE ("merriweather/MerriweatherItalic.ttf" ))
2431
2429
assert_results_contain (
2432
2430
check (fonts ),
2433
2431
WARN ,
2434
2432
"bad-filename" ,
2435
2433
"with a family that has a non-canonical italic filename." ,
2436
2434
)
2435
+ os .unlink (TEST_FILE ("merriweather/MerriweatherItalic.ttf" ))
2437
2436
2438
2437
# This check must also be able to deal with variable fonts!
2439
2438
fonts = [
2440
- "cabinvfbeta/CabinVFBeta -Italic[wdth,wght].ttf" ,
2441
- "cabinvfbeta/CabinVFBeta [wdth,wght].ttf" ,
2439
+ TEST_FILE ( "cabinvf/Cabin -Italic[wdth,wght].ttf") ,
2440
+ TEST_FILE ( "cabinvf/Cabin [wdth,wght].ttf") ,
2442
2441
]
2443
2442
assert_PASS (check (fonts ), "with a good set of varfonts..." )
2444
2443
2445
- fonts = ["cabinvfbeta/CabinVFBeta -Italic[wdth,wght].ttf" ]
2444
+ fonts = [TEST_FILE ( "cabinvf/Cabin -Italic[wdth,wght].ttf") ]
2446
2445
assert_results_contain (
2447
2446
check (fonts ),
2448
2447
FAIL ,
0 commit comments