def test_pdf(self): file = get_test_data_path('mb.pdf') with open(file, 'rb') as f: self.assertEqual(imageinfo.identify(f.read()), (0, 0, 'application/pdf', '.pdf', 10362))
def test_tiff(self): file = get_test_data_path('mb.tiff') with open(file, 'rb') as f: self.assertEqual(imageinfo.identify(f.read()), (140, 96, 'image/tiff', '.tiff', 12509))
def test_webp_vp8x(self): file = get_test_data_path('mb-vp8x.webp') with open(file, 'rb') as f: self.assertEqual(imageinfo.identify(f.read()), (140, 96, 'image/webp', '.webp', 6858))
def test_jpeg(self): file = get_test_data_path('mb.jpg') with open(file, 'rb') as f: self.assertEqual(imageinfo.identify(f.read()), (140, 96, 'image/jpeg', '.jpg', 8550))
def test_png(self): file = get_test_data_path('mb.png') with open(file, 'rb') as f: self.assertEqual(imageinfo.identify(f.read()), (140, 96, 'image/png', '.png', 11137))
def test_gif(self): file = get_test_data_path('mb.gif') with open(file, 'rb') as f: self.assertEqual(imageinfo.identify(f.read()), (140, 96, 'image/gif', '.gif', 5806))