Skip to content

Commit

Permalink
Remove old imghdr patch test (#143)
Browse files Browse the repository at this point in the history
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...
  • Loading branch information
Stormheg authored Jan 15, 2024
1 parent a905f80 commit 6c72dc5
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions tests/test_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
from unittest import mock
from xml.etree.ElementTree import ParseError as XMLParseError

import filetype

from willow.image import (
AvifImageFile,
BMPImageFile,
Expand Down Expand Up @@ -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)

0 comments on commit 6c72dc5

Please sign in to comment.