From 6c72dc57d2e0a091f14fd07835905e100bd5e908 Mon Sep 17 00:00:00 2001 From: Storm Heg Date: Mon, 15 Jan 2024 23:54:27 +0100 Subject: [PATCH] Remove old imghdr patch test (#143) Test was designed to verify an old workaround when we were still using imghdr. This workaround has been removed and there is no reason for it to continue its existence in this universe... --- tests/test_image.py | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/tests/test_image.py b/tests/test_image.py index 55f10a0..2258eb9 100644 --- a/tests/test_image.py +++ b/tests/test_image.py @@ -5,8 +5,6 @@ from unittest import mock from xml.etree.ElementTree import ParseError as XMLParseError -import filetype - from willow.image import ( AvifImageFile, BMPImageFile, @@ -306,23 +304,3 @@ def test_optimize_with_an_actual_file( self.image.optimize(f, "jpeg") mock_process.assert_called_with("tests/images/people.jpg") mock_unlink.assert_not_called() - - -class TestImghdrJPEGPatch(unittest.TestCase): - def test_detects_photoshop3_jpeg(self): - f = io.BytesIO() - f.write(b"\xff\xd8\xff\xed\x00,Photoshop 3.0\x00") - f.seek(0) - - image_format = filetype.guess_extension(f) - - self.assertEqual(image_format, "jpg") - - def test_junk(self): - f = io.BytesIO() - f.write(b"Not an image") - f.seek(0) - - image_format = filetype.guess_extension(f) - - self.assertIsNone(image_format)