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%.
This commit is contained in:
Terseus 2014-04-09 19:05:31 +02:00
parent 8228caf14d
commit 4b7236f460
3 changed files with 10 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 368 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 438 B

View File

@ -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():