From 4b7236f460c0bc9de1364d02ee0580e95db911f0 Mon Sep 17 00:00:00 2001 From: Terseus Date: Wed, 9 Apr 2014 19:05:31 +0200 Subject: [PATCH] Added tests of hor/ver lines 101px wide These tests should guarantee that the proportion of the width is maintained with a margin of error < 1%. --- Tests/images/imagedraw/line_horizontal_w101px.png | Bin 0 -> 368 bytes Tests/images/imagedraw/line_vertical_w101px.png | Bin 0 -> 438 bytes Tests/test_imagedraw.py | 10 ++++++++++ 3 files changed, 10 insertions(+) create mode 100644 Tests/images/imagedraw/line_horizontal_w101px.png create mode 100644 Tests/images/imagedraw/line_vertical_w101px.png diff --git a/Tests/images/imagedraw/line_horizontal_w101px.png b/Tests/images/imagedraw/line_horizontal_w101px.png new file mode 100644 index 0000000000000000000000000000000000000000..bbcc8133fd3975eb00d5625a97e3df0ed176ca9a GIT binary patch literal 368 zcmeAS@N?(olHy`uVBq!ia0vp^CxAGQg9%8!tv_uAq&N#aB8wRqxP?KOkzv*x37{Z* ziKnkC`#ly;K?e5sFOmWo7#R6IT^vIyZoR#-ke9)L!`1PdeAm?#>sDqsOt{lIKS5C6 zX!EKyZ|{C!wchxUJ8a{cq{ySY@_u~Pn)d#K@5TTf5$>ZwAi`-Qmb22ChI3N5He`VXYGKC+O9OtZ;G#IR0 z^={j9Y5hC5DjL1C{s&5~H3@z>cj<~Hlf1NCRi}mod4dQ{t(71F5D^F#01;gf0ib9Q zR2fio5lEQ`TnjO(!6t*WKum_%4Ym*L0Fd1f3&3U*Pz^Q%w{t-Tk?FagE4+5^{dj2Y e(n+VjmoZG2pILd>QkD}K<_w;$elF{r5}E*{Dxzxu literal 0 HcmV?d00001 diff --git a/Tests/test_imagedraw.py b/Tests/test_imagedraw.py index defb3805a..46bb43a11 100644 --- a/Tests/test_imagedraw.py +++ b/Tests/test_imagedraw.py @@ -87,6 +87,11 @@ def test_line_horizontal(): img, draw = create_base_image_draw((20, 20)) draw.line((14, 5, 5, 5), BLACK, 3) assert_image_equal(img, expected, 'line straigth horizontal inverted 3px wide failed') + expected = Image.open(os.path.join(IMAGES_PATH, 'line_horizontal_w101px.png')) + expected.load() + img, draw = create_base_image_draw((200, 110)) + draw.line((5, 55, 195, 55), BLACK, 101) + assert_image_equal(img, expected, 'line straigth horizontal 101px wide failed') def test_line_vertical(): @@ -108,6 +113,11 @@ def test_line_vertical(): img, draw = create_base_image_draw((20, 20)) draw.line((5, 14, 5, 5), BLACK, 3) assert_image_equal(img, expected, 'line straigth vertical inverted 3px wide failed') + expected = Image.open(os.path.join(IMAGES_PATH, 'line_vertical_w101px.png')) + expected.load() + img, draw = create_base_image_draw((110, 200)) + draw.line((55, 5, 55, 195), BLACK, 101) + assert_image_equal(img, expected, 'line straigth vertical 101px wide failed') def test_line_oblique_45():