From 3f9af46f88b1c796338448605f81e38f7283d5ec Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Sun, 23 Jun 2019 13:31:00 +1000 Subject: [PATCH] Added test --- Tests/test_imagefont.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Tests/test_imagefont.py b/Tests/test_imagefont.py index 3388c2055..0ee3b979e 100644 --- a/Tests/test_imagefont.py +++ b/Tests/test_imagefont.py @@ -420,6 +420,10 @@ class TestImageFont(PillowTestCase): self.assertRaises(IOError, ImageFont.load_path, filename) self.assertRaises(IOError, ImageFont.truetype, filename) + def test_load_non_font_bytes(self): + with open("Tests/images/hopper.jpg", "rb") as f: + self.assertRaises(IOError, ImageFont.truetype, f) + def test_default_font(self): # Arrange txt = 'This is a "better than nothing" default font.'