From 7caba26dc79ce72d646f1b7ea0d3585384a25eea Mon Sep 17 00:00:00 2001 From: Tsung-Po Sun Date: Sun, 31 Jan 2021 14:38:46 +0900 Subject: [PATCH] Add test --- .../continuous_horizontal_edges_polygon.png | Bin 0 -> 108 bytes Tests/test_imagedraw.py | 11 +++++++++++ 2 files changed, 11 insertions(+) create mode 100644 Tests/images/imagedraw/continuous_horizontal_edges_polygon.png diff --git a/Tests/images/imagedraw/continuous_horizontal_edges_polygon.png b/Tests/images/imagedraw/continuous_horizontal_edges_polygon.png new file mode 100644 index 0000000000000000000000000000000000000000..beffed5b918594f7952682238515cbd831a29b96 GIT binary patch literal 108 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61SBU+%rFB|#-1*YAr*6yZ*0%M|NsC0PIXC- zpuPF`?b;qDGczkT?70w literal 0 HcmV?d00001 diff --git a/Tests/test_imagedraw.py b/Tests/test_imagedraw.py index 06c5b2503..8dcd2f898 100644 --- a/Tests/test_imagedraw.py +++ b/Tests/test_imagedraw.py @@ -1326,3 +1326,14 @@ def test_compute_regular_polygon_vertices_input_error_handling( with pytest.raises(expected_error) as e: ImageDraw._compute_regular_polygon_vertices(bounding_circle, n_sides, rotation) assert str(e.value) == error_message + +def test_continuous_horizontal_edges_polygon(): + with Image.open( + os.path.join(IMAGES_PATH, "continuous_horizontal_edges_polygon.png") + ) as expected: + expected.load() + xy = [(2, 6), (12, 6), (12, 12), (8, 12), (8, 9), (8, 8), (5, 8), (4, 8), (3, 8), (2, 8), (2, 7)] + img, draw = create_base_image_draw((16, 16)) + draw.polygon(xy, BLACK) + assert_image_equal(img, expected, "continuous horizontal edges polygon failed") + \ No newline at end of file