mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-26 01:04:29 +03:00
Increased test coverage
This commit is contained in:
parent
848a629784
commit
e8af68bae2
|
@ -18,18 +18,19 @@ class TestImageShow(PillowTestCase):
|
|||
ImageShow._viewers.pop()
|
||||
|
||||
def test_show(self):
|
||||
class TestViewer:
|
||||
class TestViewer(ImageShow.Viewer):
|
||||
methodCalled = False
|
||||
|
||||
def show(self, image, title=None, **options):
|
||||
def show_image(self, image, **options):
|
||||
self.methodCalled = True
|
||||
return True
|
||||
viewer = TestViewer()
|
||||
ImageShow.register(viewer, -1)
|
||||
|
||||
im = hopper()
|
||||
self.assertTrue(ImageShow.show(im))
|
||||
self.assertTrue(viewer.methodCalled)
|
||||
for mode in ("1", "I;16", "LA", "RGB", "RGBA"):
|
||||
im = hopper(mode)
|
||||
self.assertTrue(ImageShow.show(im))
|
||||
self.assertTrue(viewer.methodCalled)
|
||||
|
||||
# Restore original state
|
||||
ImageShow._viewers.pop(0)
|
||||
|
|
Loading…
Reference in New Issue
Block a user