Skip to content

Commit

Permalink
Increased test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed May 25, 2019
1 parent 2ae9436 commit 62a6e0d
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Tests/test_imageshow.py
Expand Up @@ -18,18 +18,19 @@ def test_register(self):
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)
Expand Down

0 comments on commit 62a6e0d

Please sign in to comment.