@@ -480,14 +480,16 @@ def test_should_include_structured_values_for_low_contrast_text(self):
480480 assert finding .bbox .width > 0
481481 assert finding .bbox .height > 0
482482 assert finding .related_layers == ["layer:1" ]
483- assert finding .measured ["contrast" ] < finding .measured ["threshold" ]
484- assert finding .measured ["method" ] == "worst-tile"
485- assert finding .measured ["tile_count" ] >= 1
486- assert finding .measured ["tile_size" ] == 32
487- assert finding .measured ["tile_bbox" ]["width" ] > 0
488- assert finding .measured ["tile_bbox" ]["height" ] > 0
489- assert len (finding .measured ["foreground_rgb" ]) == 3
490- assert len (finding .measured ["background_rgb" ]) == 3
483+ assert finding .measured == {
484+ "contrast" : 1.0620159366897584 ,
485+ "threshold" : 2.0 ,
486+ "method" : "worst-tile" ,
487+ "tile_bbox" : {"x" : 10 , "y" : 10 , "width" : 32 , "height" : 32 },
488+ "tile_count" : 12 ,
489+ "tile_size" : 32 ,
490+ "foreground_rgb" : (248.0 , 248.0 , 248.0 ),
491+ "background_rgb" : (255.0 , 255.0 , 255.0 ),
492+ }
491493 assert finding .suggestion == "increase foreground/background contrast to at least 2.0:1"
492494
493495 def test_should_warn_for_worst_tile_contrast_on_busy_background (self ):
@@ -511,10 +513,16 @@ def paint_split_background(image: Image.Image) -> None:
511513 # then
512514 assert [d .code for d in diagnostics ] == ["low-contrast" ]
513515 finding = diagnostics [0 ]
514- assert finding .measured ["method" ] == "worst-tile"
515- assert finding .measured ["contrast" ] < finding .measured ["threshold" ]
516- assert finding .measured ["tile_bbox" ]["x" ] >= 116
517- assert finding .measured ["background_rgb" ][0 ] > 240
516+ assert finding .measured == {
517+ "contrast" : 1.0 ,
518+ "threshold" : 2.0 ,
519+ "method" : "worst-tile" ,
520+ "tile_bbox" : {"x" : 116 , "y" : 30 , "width" : 32 , "height" : 26 },
521+ "tile_count" : 6 ,
522+ "tile_size" : 32 ,
523+ "foreground_rgb" : (255.0 , 255.0 , 255.0 ),
524+ "background_rgb" : (255.0 , 255.0 , 255.0 ),
525+ }
518526
519527 def test_should_ignore_low_contrast_tiles_without_text_pixels (self ):
520528 """Whitespace inside the text bbox does not drive low-contrast findings"""
0 commit comments