This commit is contained in:
Hugo 2017-05-16 10:33:38 +03:00
parent 6e9e4c1027
commit 08c72a1720
2 changed files with 7 additions and 7 deletions

View File

@ -283,6 +283,7 @@ def Draw(im, mode=None):
except AttributeError: except AttributeError:
return ImageDraw(im, mode) return ImageDraw(im, mode)
# experimental access to the outline API # experimental access to the outline API
try: try:
Outline = Image.core.outline Outline = Image.core.outline

View File

@ -136,8 +136,7 @@ class TestImageDraw(PillowTestCase):
del draw del draw
# Assert # Assert
self.assert_image_similar( self.assert_image_similar(im, Image.open(expected), 1)
im, Image.open(expected), 1)
def test_chord1(self): def test_chord1(self):
for mode in ["RGB", "L"]: for mode in ["RGB", "L"]:
@ -160,8 +159,7 @@ class TestImageDraw(PillowTestCase):
del draw del draw
# Assert # Assert
self.assert_image_similar( self.assert_image_similar(im, Image.open(expected), 1)
im, Image.open(expected), 1)
def test_ellipse1(self): def test_ellipse1(self):
for mode in ["RGB", "L"]: for mode in ["RGB", "L"]:
@ -313,15 +311,15 @@ class TestImageDraw(PillowTestCase):
# Arrange # Arrange
im = Image.new(mode, (W, H)) im = Image.new(mode, (W, H))
draw = ImageDraw.Draw(im) draw = ImageDraw.Draw(im)
expected = "Tests/images/imagedraw_polygon_kite_{}.png".format(mode) expected = "Tests/images/imagedraw_polygon_kite_{}.png".format(
mode)
# Act # Act
draw.polygon(KITE_POINTS, fill="blue", outline="yellow") draw.polygon(KITE_POINTS, fill="blue", outline="yellow")
del draw del draw
# Assert # Assert
self.assert_image_equal( self.assert_image_equal(im, Image.open(expected))
im, Image.open(expected))
def helper_rectangle(self, bbox): def helper_rectangle(self, bbox):
# Arrange # Arrange
@ -564,5 +562,6 @@ class TestImageDraw(PillowTestCase):
# Assert # Assert
self.assert_image_similar(im, Image.open(expected), 1) self.assert_image_similar(im, Image.open(expected), 1)
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()