Test experimental floodfill()

This commit is contained in:
hugovk 2014-05-12 23:27:02 +03:00
parent 6b274b4c5e
commit 961db29ff6
2 changed files with 16 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 232 B

View File

@ -1,6 +1,7 @@
from tester import *
from PIL import Image
from PIL import ImageColor
from PIL import ImageDraw
# Image size
@ -219,4 +220,19 @@ def test_rectangle2():
helper_rectangle(bbox2)
def test_floodfill():
# Arrange
im = Image.new("RGB", (w, h))
draw = ImageDraw.Draw(im)
draw.rectangle(bbox2, outline="yellow", fill="green")
centre_point = (int(w/2), int(h/2))
# Act
ImageDraw.floodfill(im, centre_point, ImageColor.getrgb("red"))
del draw
# Assert
assert_image_equal(im, Image.open("Tests/images/imagedraw_floodfill.png"))
# End of file