Added mime type tests

This commit is contained in:
Andrew Murray 2019-03-04 15:02:47 +11:00
parent a62c825922
commit 8f34621c14
3 changed files with 4 additions and 0 deletions

View File

@ -14,6 +14,7 @@ class TestFileIco(PillowTestCase):
self.assertEqual(im.mode, "RGBA")
self.assertEqual(im.size, (16, 16))
self.assertEqual(im.format, "ICO")
self.assertEqual(im.get_format_mimetype(), "image/x-icon")
def test_invalid_file(self):
with open("Tests/images/flower.jpg", "rb") as fp:

View File

@ -13,6 +13,7 @@ class TestFilePcx(PillowTestCase):
self.assertEqual(im2.mode, im.mode)
self.assertEqual(im2.size, im.size)
self.assertEqual(im2.format, "PCX")
self.assertEqual(im2.get_format_mimetype(), "image/x-pcx")
self.assert_image_equal(im2, im)
def test_sanity(self):

View File

@ -37,6 +37,8 @@ class TestFileTga(PillowTestCase):
path_no_ext, origin, "rle" if rle else "raw")
original_im = Image.open(tga_path)
self.assertEqual(original_im.format, "TGA")
self.assertEqual(original_im.get_format_mimetype(), "image/x-tga")
if rle:
self.assertEqual(
original_im.info["compression"], "tga_rle")