From e2cb2195eb3bc90c1f3bc47a375802d8416f804a Mon Sep 17 00:00:00 2001 From: Terseus Date: Fri, 4 Apr 2014 11:46:58 +0200 Subject: [PATCH] Added test for a simple right triangle The diagonals of the right angled edges must be perfect and the bottom vertice should be drawn. --- Tests/images/imagedraw/triangle_right.png | Bin 0 -> 168 bytes Tests/test_imagedraw.py | 7 +++++++ 2 files changed, 7 insertions(+) create mode 100644 Tests/images/imagedraw/triangle_right.png diff --git a/Tests/images/imagedraw/triangle_right.png b/Tests/images/imagedraw/triangle_right.png new file mode 100644 index 0000000000000000000000000000000000000000..e91fa580234157bcbe1784671e6b3a89d36f7fef GIT binary patch literal 168 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1SFYWcSQjy&H|6fVg?3oVGw3ym^DWND9B#o z>FdgVkA;O(OXD=}PE(+eyQhm|h{fsT8{6~m|NsC0q_X6RYdiDr+qEssGiKIg=sv6R z^2np~N2N*MjVD?awwW1PeQY&zoXhe^a=+i9k3H_sJN$1upGsrkyqq5t@`6nTXe5KD LtDnm{r-UW|g`qaL literal 0 HcmV?d00001 diff --git a/Tests/test_imagedraw.py b/Tests/test_imagedraw.py index 138c14cca..45f9d5f03 100644 --- a/Tests/test_imagedraw.py +++ b/Tests/test_imagedraw.py @@ -63,3 +63,10 @@ def test_square(): draw.rectangle((7, 7, 2, 2), BLACK) assert_image_equal(img, expected) + +def test_triangle_right(): + expected = Image.open(os.path.join(IMAGES_PATH, 'triangle_right.png')) + expected.load() + img, draw = create_base_image_draw((20, 20)) + draw.polygon([(3, 5), (17, 5), (10, 12)], BLACK) + assert_image_equal(img, expected)