mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-06-06 06:03:14 +03:00
Merge f405b1e4c3
into 7e4d8e2f55
This commit is contained in:
commit
0272251381
|
@ -51,6 +51,9 @@ def test_save(tmp_path: Path) -> None:
|
||||||
|
|
||||||
|
|
||||||
def test_handler(tmp_path: Path) -> None:
|
def test_handler(tmp_path: Path) -> None:
|
||||||
|
if BufrStubImagePlugin._handler is not None:
|
||||||
|
return
|
||||||
|
|
||||||
class TestHandler(ImageFile.StubHandler):
|
class TestHandler(ImageFile.StubHandler):
|
||||||
opened = False
|
opened = False
|
||||||
loaded = False
|
loaded = False
|
||||||
|
|
|
@ -51,6 +51,9 @@ def test_save(tmp_path: Path) -> None:
|
||||||
|
|
||||||
|
|
||||||
def test_handler(tmp_path: Path) -> None:
|
def test_handler(tmp_path: Path) -> None:
|
||||||
|
if GribStubImagePlugin._handler is not None:
|
||||||
|
return
|
||||||
|
|
||||||
class TestHandler(ImageFile.StubHandler):
|
class TestHandler(ImageFile.StubHandler):
|
||||||
opened = False
|
opened = False
|
||||||
loaded = False
|
loaded = False
|
||||||
|
|
|
@ -53,6 +53,9 @@ def test_save() -> None:
|
||||||
|
|
||||||
|
|
||||||
def test_handler(tmp_path: Path) -> None:
|
def test_handler(tmp_path: Path) -> None:
|
||||||
|
if Hdf5StubImagePlugin._handler is not None:
|
||||||
|
return
|
||||||
|
|
||||||
class TestHandler(ImageFile.StubHandler):
|
class TestHandler(ImageFile.StubHandler):
|
||||||
opened = False
|
opened = False
|
||||||
loaded = False
|
loaded = False
|
||||||
|
|
|
@ -53,15 +53,19 @@ def test_render() -> None:
|
||||||
assert_image_equal_tofile(im, "Tests/images/drawing.emf")
|
assert_image_equal_tofile(im, "Tests/images/drawing.emf")
|
||||||
|
|
||||||
|
|
||||||
|
class TestHandler(ImageFile.StubHandler):
|
||||||
|
methodCalled = False
|
||||||
|
|
||||||
|
def load(self, im: ImageFile.StubImageFile) -> Image.Image:
|
||||||
|
return Image.new("RGB", (1, 1))
|
||||||
|
|
||||||
|
def save(self, im: Image.Image, fp: IO[bytes], filename: str) -> None:
|
||||||
|
self.methodCalled = True
|
||||||
|
|
||||||
|
|
||||||
def test_register_handler(tmp_path: Path) -> None:
|
def test_register_handler(tmp_path: Path) -> None:
|
||||||
class TestHandler(ImageFile.StubHandler):
|
if isinstance(WmfImagePlugin._handler, TestHandler):
|
||||||
methodCalled = False
|
return
|
||||||
|
|
||||||
def load(self, im: ImageFile.StubImageFile) -> Image.Image:
|
|
||||||
return Image.new("RGB", (1, 1))
|
|
||||||
|
|
||||||
def save(self, im: Image.Image, fp: IO[bytes], filename: str) -> None:
|
|
||||||
self.methodCalled = True
|
|
||||||
|
|
||||||
handler = TestHandler()
|
handler = TestHandler()
|
||||||
original_handler = WmfImagePlugin._handler
|
original_handler = WmfImagePlugin._handler
|
||||||
|
|
Loading…
Reference in New Issue
Block a user