From 18584dc645bfca94b2b6566f3fcdb07a9d0f8e6c Mon Sep 17 00:00:00 2001 From: Samuel Dunn Date: Sat, 24 Jun 2017 10:47:53 -0700 Subject: [PATCH] Add tests for standard wxImageHandler derivations --- unittests/test_image.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/unittests/test_image.py b/unittests/test_image.py index d18ceaef..a27f88d0 100644 --- a/unittests/test_image.py +++ b/unittests/test_image.py @@ -260,7 +260,37 @@ class image_Tests(wtc.WidgetTestCase): imghndlr = TestImageHandler() wx.Image.AddHandler(imghndlr) + def test_imageHandlerStandardDerivations(self): + # checks that all of the standard wx derivations are available. + wx.GIFHandler() + wx.IFFHandler() + wx.JPEGHandler() + wx.PCXHandler() + wx.PNGHandler() + wx.PNMHandler() + wx.TGAHandler() + wx.TIFFHandler() + wx.XPMHandler() + def test_imageHandlerStandardDerivationsDerivation(self): + for cls in (wx.GIFHandler, wx.IFFHandler, wx.JPEGHandler, + wx.PCXHandler, wx.PNGHandler, wx.PNMHandler, + wx.TGAHandler, wx.TIFFHandler,wx.XPMHandler): + + class TestImageHandler(cls): + def __init__(self): + cls.__init__(self) + self.Name = "%s File" % cls.__name__ + self.Extension = "foo" + self.MimeType = 'image/foo' + self.Type = wx.BITMAP_TYPE_JPEG + + def DoCanRead(self, stream): + return True + + imghndlr = TestImageHandler() + wx.Image.AddHandler(imghndlr) + #---------------------------------------------------------------------------