Test drawing a rectangle bigger than the image

This commit is contained in:
hugovk 2017-05-15 21:44:28 +03:00
parent 5871b7a5ba
commit f1631e0d05
2 changed files with 17 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 290 B

View File

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