mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-24 17:06:16 +03:00
Test drawing a rectangle bigger than the image
This commit is contained in:
parent
5871b7a5ba
commit
f1631e0d05
BIN
Tests/images/imagedraw_big_rectangle.png
Normal file
BIN
Tests/images/imagedraw_big_rectangle.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 290 B |
|
@ -311,6 +311,23 @@ class TestImageDraw(PillowTestCase):
|
|||
def test_rectangle2(self):
|
||||
self.helper_rectangle(BBOX2)
|
||||
|
||||
def test_big_rectangle(self):
|
||||
# Test drawing a rectangle bigger than the image
|
||||
# Arrange
|
||||
im = Image.new("RGB", (W, H))
|
||||
bbox = [(-1, -1), (W+1, H+1)]
|
||||
draw = ImageDraw.Draw(im)
|
||||
expected = "Tests/images/imagedraw_big_rectangle.png"
|
||||
|
||||
# Act
|
||||
draw.rectangle(bbox, fill="orange")
|
||||
del draw
|
||||
im.show()
|
||||
im.save(expected)
|
||||
|
||||
# Assert
|
||||
self.assert_image_similar(im, Image.open(expected), 1)
|
||||
|
||||
def test_floodfill(self):
|
||||
# Arrange
|
||||
im = Image.new("RGB", (W, H))
|
||||
|
|
Loading…
Reference in New Issue
Block a user