mirror of
https://github.com/fergalmoran/picard.git
synced 2025-12-25 02:40:03 +00:00
PICARD-1762: fix broken PDF identification
In identify(), comparaison was done against `str` instead of `bytecode`, due to the lack of `b` prefix ImageInfoTest: add missing test PDF file identification
This commit is contained in:
committed by
Philipp Wolfer
parent
170b8e0aa7
commit
3585d40b0b
@@ -241,6 +241,15 @@ class ImageInfoTest(PicardTestCase):
|
||||
(140, 96, 'image/jpeg', '.jpg', 8550)
|
||||
)
|
||||
|
||||
def test_pdf(self):
|
||||
file = os.path.join('test', 'data', 'mb.pdf')
|
||||
|
||||
with open(file, 'rb') as f:
|
||||
self.assertEqual(
|
||||
imageinfo.identify(f.read()),
|
||||
(0, 0, 'application/pdf', '.pdf', 10362)
|
||||
)
|
||||
|
||||
def test_not_enough_data(self):
|
||||
self.assertRaises(imageinfo.IdentificationError,
|
||||
imageinfo.identify, "x")
|
||||
|
||||
Reference in New Issue
Block a user