mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-26 17:24:31 +03:00
Added test for vertical lines.
The behavior is consistent with horizontal lines, see previous commit for details.
This commit is contained in:
parent
fee2faa8dc
commit
1c02d467ef
BIN
Tests/images/imagedraw/line_vertical_w2px_inverted.png
Normal file
BIN
Tests/images/imagedraw/line_vertical_w2px_inverted.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 145 B |
BIN
Tests/images/imagedraw/line_vertical_w2px_normal.png
Normal file
BIN
Tests/images/imagedraw/line_vertical_w2px_normal.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 144 B |
BIN
Tests/images/imagedraw/line_vertical_w3px.png
Normal file
BIN
Tests/images/imagedraw/line_vertical_w3px.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 142 B |
|
@ -95,3 +95,28 @@ 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)
|
||||
|
||||
|
||||
def test_line_vertical():
|
||||
# Normal 2px line
|
||||
expected = Image.open(os.path.join(IMAGES_PATH, 'line_vertical_w2px_normal.png'))
|
||||
expected.load()
|
||||
img, draw = create_base_image_draw((20, 20))
|
||||
draw.line((5, 5, 5, 14), BLACK, 2)
|
||||
assert_image_equal(img, expected)
|
||||
# Inverted 2px line
|
||||
expected = Image.open(os.path.join(IMAGES_PATH, 'line_vertical_w2px_inverted.png'))
|
||||
expected.load()
|
||||
img, draw = create_base_image_draw((20, 20))
|
||||
draw.line((5, 14, 5, 5), BLACK, 2)
|
||||
assert_image_equal(img, expected)
|
||||
# Normal 3px line
|
||||
expected = Image.open(os.path.join(IMAGES_PATH, 'line_vertical_w3px.png'))
|
||||
expected.load()
|
||||
img, draw = create_base_image_draw((20, 20))
|
||||
draw.line((5, 5, 5, 14), BLACK, 3)
|
||||
assert_image_equal(img, expected)
|
||||
# Inverted 3px line
|
||||
img, draw = create_base_image_draw((20, 20))
|
||||
draw.line((5, 14, 5, 5), BLACK, 3)
|
||||
assert_image_equal(img, expected)
|
||||
|
|
Loading…
Reference in New Issue
Block a user