mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-26 01:04:29 +03:00
test for issue #2666
This commit is contained in:
parent
bb7124325e
commit
c3fbd9de01
|
@ -404,10 +404,24 @@ class TestImageFont(PillowTestCase):
|
|||
self.assert_image_equal(im, target_img)
|
||||
|
||||
def test_getsize_empty(self):
|
||||
# issue #2614
|
||||
font = self.get_font()
|
||||
# should not crash.
|
||||
self.assertEqual((0, 0), font.getsize(''))
|
||||
|
||||
def test_render_empty(self):
|
||||
# issue 2666
|
||||
font = self.get_font()
|
||||
im = Image.new(mode='RGB', size=(300, 100))
|
||||
target = im.copy()
|
||||
draw = ImageDraw.Draw(im)
|
||||
#should not crash here.
|
||||
draw.text((10, 10), '', font=font)
|
||||
self.assert_image_equal(im, target)
|
||||
|
||||
|
||||
|
||||
|
||||
def _test_fake_loading_font(self, path_to_fake, fontname):
|
||||
# Make a copy of FreeTypeFont so we can patch the original
|
||||
free_type_font = copy.deepcopy(ImageFont.FreeTypeFont)
|
||||
|
|
Loading…
Reference in New Issue
Block a user