mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-11 12:17:14 +03:00
d50445ff30
Similar to the recent adoption of Black. isort is a Python utility to sort imports alphabetically and automatically separate into sections. By using isort, contributors can quickly and automatically conform to the projects style without thinking. Just let the tool do it. Uses the configuration recommended by the Black to avoid conflicts of style. Rewrite TestImageQt.test_deprecated to no rely on import order.
21 lines
563 B
Python
21 lines
563 B
Python
from PIL import GdImageFile
|
|
|
|
from .helper import PillowTestCase
|
|
|
|
TEST_GD_FILE = "Tests/images/hopper.gd"
|
|
|
|
|
|
class TestFileGd(PillowTestCase):
|
|
def test_sanity(self):
|
|
im = GdImageFile.open(TEST_GD_FILE)
|
|
self.assertEqual(im.size, (128, 128))
|
|
self.assertEqual(im.format, "GD")
|
|
|
|
def test_bad_mode(self):
|
|
self.assertRaises(ValueError, GdImageFile.open, TEST_GD_FILE, "bad mode")
|
|
|
|
def test_invalid_file(self):
|
|
invalid_file = "Tests/images/flower.jpg"
|
|
|
|
self.assertRaises(IOError, GdImageFile.open, invalid_file)
|