Use assert_image_equal_tofile

This commit is contained in:
Andrew Murray 2021-03-20 22:42:10 +11:00
parent 9a4b1301de
commit 006de79d60

View File

@ -1352,19 +1352,18 @@ def test_compute_regular_polygon_vertices_input_error_handling(
def test_continuous_horizontal_edges_polygon(): def test_continuous_horizontal_edges_polygon():
with Image.open( xy = [
os.path.join(IMAGES_PATH, "continuous_horizontal_edges_polygon.png") (2, 6),
) as expected: (12, 6),
expected.load() (12, 12),
xy = [ (8, 12),
(2, 6), (8, 8),
(12, 6), (4, 8),
(12, 12), (2, 8),
(8, 12), ]
(8, 8), img, draw = create_base_image_draw((16, 16))
(4, 8), draw.polygon(xy, BLACK)
(2, 8), expected = os.path.join(IMAGES_PATH, "continuous_horizontal_edges_polygon.png")
] assert_image_equal_tofile(
img, draw = create_base_image_draw((16, 16)) img, expected, "continuous horizontal edges polygon failed"
draw.polygon(xy, BLACK) )
assert_image_equal(img, expected, "continuous horizontal edges polygon failed")