From c4d3898006b5d5c5af90312e15ba558e1bcd3a01 Mon Sep 17 00:00:00 2001 From: hugovk Date: Fri, 6 Jun 2014 16:55:00 +0300 Subject: [PATCH] Convert more tests --- Tests/test_file_ico.py | 14 --- Tests/test_font_bdf.py | 13 --- Tests/test_image_offset.py | 16 --- Tests/test_imagecms.py | 203 ----------------------------------- Tests/test_imagemode.py | 23 ---- Tests/test_imageshow.py | 6 -- Tests/test_imagetk.py | 9 -- Tests/test_imagewin.py | 6 -- test/helper.py | 5 +- test/test_file_ico.py | 23 ++++ test/test_font_bdf.py | 22 ++++ test/test_image_offset.py | 25 +++++ test/test_imagecms.py | 214 +++++++++++++++++++++++++++++++++++++ test/test_imagemode.py | 32 ++++++ test/test_imageshow.py | 18 ++++ test/test_imagetk.py | 17 +++ test/test_imagewin.py | 18 ++++ 17 files changed, 372 insertions(+), 292 deletions(-) delete mode 100644 Tests/test_file_ico.py delete mode 100644 Tests/test_font_bdf.py delete mode 100644 Tests/test_image_offset.py delete mode 100644 Tests/test_imagecms.py delete mode 100644 Tests/test_imagemode.py delete mode 100644 Tests/test_imageshow.py delete mode 100644 Tests/test_imagetk.py delete mode 100644 Tests/test_imagewin.py create mode 100644 test/test_file_ico.py create mode 100644 test/test_font_bdf.py create mode 100644 test/test_image_offset.py create mode 100644 test/test_imagecms.py create mode 100644 test/test_imagemode.py create mode 100644 test/test_imageshow.py create mode 100644 test/test_imagetk.py create mode 100644 test/test_imagewin.py diff --git a/Tests/test_file_ico.py b/Tests/test_file_ico.py deleted file mode 100644 index e0db34acc..000000000 --- a/Tests/test_file_ico.py +++ /dev/null @@ -1,14 +0,0 @@ -from tester import * - -from PIL import Image - -# sample ppm stream -file = "Images/lena.ico" -data = open(file, "rb").read() - -def test_sanity(): - im = Image.open(file) - im.load() - assert_equal(im.mode, "RGBA") - assert_equal(im.size, (16, 16)) - assert_equal(im.format, "ICO") diff --git a/Tests/test_font_bdf.py b/Tests/test_font_bdf.py deleted file mode 100644 index 366bb4468..000000000 --- a/Tests/test_font_bdf.py +++ /dev/null @@ -1,13 +0,0 @@ -from tester import * - -from PIL import Image, FontFile, BdfFontFile - -filename = "Images/courB08.bdf" - -def test_sanity(): - - file = open(filename, "rb") - font = BdfFontFile.BdfFontFile(file) - - assert_true(isinstance(font, FontFile.FontFile)) - assert_equal(len([_f for _f in font.glyph if _f]), 190) diff --git a/Tests/test_image_offset.py b/Tests/test_image_offset.py deleted file mode 100644 index f6356907a..000000000 --- a/Tests/test_image_offset.py +++ /dev/null @@ -1,16 +0,0 @@ -from tester import * - -from PIL import Image - -def test_offset(): - - im1 = lena() - - im2 = assert_warning(DeprecationWarning, lambda: im1.offset(10)) - assert_equal(im1.getpixel((0, 0)), im2.getpixel((10, 10))) - - im2 = assert_warning(DeprecationWarning, lambda: im1.offset(10, 20)) - assert_equal(im1.getpixel((0, 0)), im2.getpixel((10, 20))) - - im2 = assert_warning(DeprecationWarning, lambda: im1.offset(20, 20)) - assert_equal(im1.getpixel((0, 0)), im2.getpixel((20, 20))) diff --git a/Tests/test_imagecms.py b/Tests/test_imagecms.py deleted file mode 100644 index f52101eb1..000000000 --- a/Tests/test_imagecms.py +++ /dev/null @@ -1,203 +0,0 @@ -from tester import * - -from PIL import Image -try: - from PIL import ImageCms - ImageCms.core.profile_open -except ImportError: - skip() - -SRGB = "Tests/icc/sRGB.icm" - - -def test_sanity(): - - # basic smoke test. - # this mostly follows the cms_test outline. - - v = ImageCms.versions() # should return four strings - assert_equal(v[0], '1.0.0 pil') - assert_equal(list(map(type, v)), [str, str, str, str]) - - # internal version number - assert_match(ImageCms.core.littlecms_version, "\d+\.\d+$") - - i = ImageCms.profileToProfile(lena(), SRGB, SRGB) - assert_image(i, "RGB", (128, 128)) - - i = lena() - ImageCms.profileToProfile(i, SRGB, SRGB, inPlace=True) - assert_image(i, "RGB", (128, 128)) - - t = ImageCms.buildTransform(SRGB, SRGB, "RGB", "RGB") - i = ImageCms.applyTransform(lena(), t) - assert_image(i, "RGB", (128, 128)) - - i = lena() - t = ImageCms.buildTransform(SRGB, SRGB, "RGB", "RGB") - ImageCms.applyTransform(lena(), t, inPlace=True) - assert_image(i, "RGB", (128, 128)) - - p = ImageCms.createProfile("sRGB") - o = ImageCms.getOpenProfile(SRGB) - t = ImageCms.buildTransformFromOpenProfiles(p, o, "RGB", "RGB") - i = ImageCms.applyTransform(lena(), t) - assert_image(i, "RGB", (128, 128)) - - t = ImageCms.buildProofTransform(SRGB, SRGB, SRGB, "RGB", "RGB") - assert_equal(t.inputMode, "RGB") - assert_equal(t.outputMode, "RGB") - i = ImageCms.applyTransform(lena(), t) - assert_image(i, "RGB", (128, 128)) - - # test PointTransform convenience API - lena().point(t) - - -def test_name(): - # get profile information for file - assert_equal(ImageCms.getProfileName(SRGB).strip(), - 'IEC 61966-2.1 Default RGB colour space - sRGB') - - -def test_info(): - assert_equal(ImageCms.getProfileInfo(SRGB).splitlines(), - ['sRGB IEC61966-2.1', '', - 'Copyright (c) 1998 Hewlett-Packard Company', '']) - - -def test_copyright(): - assert_equal(ImageCms.getProfileCopyright(SRGB).strip(), - 'Copyright (c) 1998 Hewlett-Packard Company') - - -def test_manufacturer(): - assert_equal(ImageCms.getProfileManufacturer(SRGB).strip(), - 'IEC http://www.iec.ch') - - -def test_model(): - assert_equal(ImageCms.getProfileModel(SRGB).strip(), - 'IEC 61966-2.1 Default RGB colour space - sRGB') - - -def test_description(): - assert_equal(ImageCms.getProfileDescription(SRGB).strip(), - 'sRGB IEC61966-2.1') - - -def test_intent(): - assert_equal(ImageCms.getDefaultIntent(SRGB), 0) - assert_equal(ImageCms.isIntentSupported( - SRGB, ImageCms.INTENT_ABSOLUTE_COLORIMETRIC, - ImageCms.DIRECTION_INPUT), 1) - - -def test_profile_object(): - # same, using profile object - p = ImageCms.createProfile("sRGB") -# assert_equal(ImageCms.getProfileName(p).strip(), -# 'sRGB built-in - (lcms internal)') -# assert_equal(ImageCms.getProfileInfo(p).splitlines(), -# ['sRGB built-in', '', 'WhitePoint : D65 (daylight)', '', '']) - assert_equal(ImageCms.getDefaultIntent(p), 0) - assert_equal(ImageCms.isIntentSupported( - p, ImageCms.INTENT_ABSOLUTE_COLORIMETRIC, - ImageCms.DIRECTION_INPUT), 1) - - -def test_extensions(): - # extensions - i = Image.open("Tests/images/rgb.jpg") - p = ImageCms.getOpenProfile(BytesIO(i.info["icc_profile"])) - assert_equal(ImageCms.getProfileName(p).strip(), - 'IEC 61966-2.1 Default RGB colour space - sRGB') - - -def test_exceptions(): - # the procedural pyCMS API uses PyCMSError for all sorts of errors - assert_exception( - ImageCms.PyCMSError, - lambda: ImageCms.profileToProfile(lena(), "foo", "bar")) - assert_exception( - ImageCms.PyCMSError, - lambda: ImageCms.buildTransform("foo", "bar", "RGB", "RGB")) - assert_exception( - ImageCms.PyCMSError, - lambda: ImageCms.getProfileName(None)) - assert_exception( - ImageCms.PyCMSError, - lambda: ImageCms.isIntentSupported(SRGB, None, None)) - - -def test_display_profile(): - # try fetching the profile for the current display device - assert_no_exception(lambda: ImageCms.get_display_profile()) - - -def test_lab_color_profile(): - ImageCms.createProfile("LAB", 5000) - ImageCms.createProfile("LAB", 6500) - - -def test_simple_lab(): - i = Image.new('RGB', (10, 10), (128, 128, 128)) - - pLab = ImageCms.createProfile("LAB") - t = ImageCms.buildTransform(SRGB, pLab, "RGB", "LAB") - - i_lab = ImageCms.applyTransform(i, t) - - assert_equal(i_lab.mode, 'LAB') - - k = i_lab.getpixel((0, 0)) - assert_equal(k, (137, 128, 128)) # not a linear luminance map. so L != 128 - - L = i_lab.getdata(0) - a = i_lab.getdata(1) - b = i_lab.getdata(2) - - assert_equal(list(L), [137] * 100) - assert_equal(list(a), [128] * 100) - assert_equal(list(b), [128] * 100) - - -def test_lab_color(): - pLab = ImageCms.createProfile("LAB") - t = ImageCms.buildTransform(SRGB, pLab, "RGB", "LAB") - # Need to add a type mapping for some PIL type to TYPE_Lab_8 in - # findLCMSType, and have that mapping work back to a PIL mode (likely RGB). - i = ImageCms.applyTransform(lena(), t) - assert_image(i, "LAB", (128, 128)) - - # i.save('temp.lab.tif') # visually verified vs PS. - - target = Image.open('Tests/images/lena.Lab.tif') - - assert_image_similar(i, target, 30) - - -def test_lab_srgb(): - pLab = ImageCms.createProfile("LAB") - t = ImageCms.buildTransform(pLab, SRGB, "LAB", "RGB") - - img = Image.open('Tests/images/lena.Lab.tif') - - img_srgb = ImageCms.applyTransform(img, t) - - # img_srgb.save('temp.srgb.tif') # visually verified vs ps. - - assert_image_similar(lena(), img_srgb, 30) - - -def test_lab_roundtrip(): - # check to see if we're at least internally consistent. - pLab = ImageCms.createProfile("LAB") - t = ImageCms.buildTransform(SRGB, pLab, "RGB", "LAB") - - t2 = ImageCms.buildTransform(pLab, SRGB, "LAB", "RGB") - - i = ImageCms.applyTransform(lena(), t) - out = ImageCms.applyTransform(i, t2) - - assert_image_similar(lena(), out, 2) diff --git a/Tests/test_imagemode.py b/Tests/test_imagemode.py deleted file mode 100644 index 54b04435f..000000000 --- a/Tests/test_imagemode.py +++ /dev/null @@ -1,23 +0,0 @@ -from tester import * - -from PIL import Image -from PIL import ImageMode - -ImageMode.getmode("1") -ImageMode.getmode("L") -ImageMode.getmode("P") -ImageMode.getmode("RGB") -ImageMode.getmode("I") -ImageMode.getmode("F") - -m = ImageMode.getmode("1") -assert_equal(m.mode, "1") -assert_equal(m.bands, ("1",)) -assert_equal(m.basemode, "L") -assert_equal(m.basetype, "L") - -m = ImageMode.getmode("RGB") -assert_equal(m.mode, "RGB") -assert_equal(m.bands, ("R", "G", "B")) -assert_equal(m.basemode, "RGB") -assert_equal(m.basetype, "L") diff --git a/Tests/test_imageshow.py b/Tests/test_imageshow.py deleted file mode 100644 index 99ec005c8..000000000 --- a/Tests/test_imageshow.py +++ /dev/null @@ -1,6 +0,0 @@ -from tester import * - -from PIL import Image -from PIL import ImageShow - -success() diff --git a/Tests/test_imagetk.py b/Tests/test_imagetk.py deleted file mode 100644 index b30971e8f..000000000 --- a/Tests/test_imagetk.py +++ /dev/null @@ -1,9 +0,0 @@ -from tester import * - -from PIL import Image -try: - from PIL import ImageTk -except (OSError, ImportError) as v: - skip(v) - -success() diff --git a/Tests/test_imagewin.py b/Tests/test_imagewin.py deleted file mode 100644 index 268a75b6f..000000000 --- a/Tests/test_imagewin.py +++ /dev/null @@ -1,6 +0,0 @@ -from tester import * - -from PIL import Image -from PIL import ImageWin - -success() diff --git a/test/helper.py b/test/helper.py index ebe651120..54739cf7b 100644 --- a/test/helper.py +++ b/test/helper.py @@ -60,18 +60,19 @@ class PillowTestCase(unittest.TestCase): def assert_warning(self, warn_class, func): import warnings + result = None with warnings.catch_warnings(record=True) as w: # Cause all warnings to always be triggered. warnings.simplefilter("always") # Hopefully trigger a warning. - func() + result = func() # Verify some things. self.assertEqual(len(w), 1) assert issubclass(w[-1].category, warn_class) self.assertIn("deprecated", str(w[-1].message)) - + return result # # require that deprecation warnings are triggered # import warnings diff --git a/test/test_file_ico.py b/test/test_file_ico.py new file mode 100644 index 000000000..dc289e1d2 --- /dev/null +++ b/test/test_file_ico.py @@ -0,0 +1,23 @@ +from helper import unittest, PillowTestCase + +from PIL import Image + +# sample ppm stream +file = "Images/lena.ico" +data = open(file, "rb").read() + + +class TestFileIco(PillowTestCase): + + def test_sanity(self): + im = Image.open(file) + im.load() + self.assertEqual(im.mode, "RGBA") + self.assertEqual(im.size, (16, 16)) + self.assertEqual(im.format, "ICO") + + +if __name__ == '__main__': + unittest.main() + +# End of file diff --git a/test/test_font_bdf.py b/test/test_font_bdf.py new file mode 100644 index 000000000..b141e6149 --- /dev/null +++ b/test/test_font_bdf.py @@ -0,0 +1,22 @@ +from helper import unittest, PillowTestCase + +from PIL import FontFile, BdfFontFile + +filename = "Images/courB08.bdf" + + +class TestImage(PillowTestCase): + + def test_sanity(self): + + file = open(filename, "rb") + font = BdfFontFile.BdfFontFile(file) + + self.assertIsInstance(font, FontFile.FontFile) + self.assertEqual(len([_f for _f in font.glyph if _f]), 190) + + +if __name__ == '__main__': + unittest.main() + +# End of file diff --git a/test/test_image_offset.py b/test/test_image_offset.py new file mode 100644 index 000000000..bb9b5a38c --- /dev/null +++ b/test/test_image_offset.py @@ -0,0 +1,25 @@ +from helper import unittest, PillowTestCase, lena + + +class TestImage(PillowTestCase): + + def test_offset(self): + + im1 = lena() + + im2 = self.assert_warning(DeprecationWarning, lambda: im1.offset(10)) + self.assertEqual(im1.getpixel((0, 0)), im2.getpixel((10, 10))) + + im2 = self.assert_warning( + DeprecationWarning, lambda: im1.offset(10, 20)) + self.assertEqual(im1.getpixel((0, 0)), im2.getpixel((10, 20))) + + im2 = self.assert_warning( + DeprecationWarning, lambda: im1.offset(20, 20)) + self.assertEqual(im1.getpixel((0, 0)), im2.getpixel((20, 20))) + + +if __name__ == '__main__': + unittest.main() + +# End of file diff --git a/test/test_imagecms.py b/test/test_imagecms.py new file mode 100644 index 000000000..1a31636e8 --- /dev/null +++ b/test/test_imagecms.py @@ -0,0 +1,214 @@ +from helper import unittest, PillowTestCase, lena + +from PIL import Image + +try: + from PIL import ImageCms + ImageCms.core.profile_open +except ImportError as v: + # Skipped via setUp() + pass + + +SRGB = "Tests/icc/sRGB.icm" + + +class TestImage(PillowTestCase): + + def setUp(self): + try: + from PIL import ImageCms + except ImportError as v: + self.skipTest(v) + + def test_sanity(self): + + # basic smoke test. + # this mostly follows the cms_test outline. + + v = ImageCms.versions() # should return four strings + self.assertEqual(v[0], '1.0.0 pil') + self.assertEqual(list(map(type, v)), [str, str, str, str]) + + # internal version number + self.assertRegexpMatches(ImageCms.core.littlecms_version, "\d+\.\d+$") + + i = ImageCms.profileToProfile(lena(), SRGB, SRGB) + self.assert_image(i, "RGB", (128, 128)) + + i = lena() + ImageCms.profileToProfile(i, SRGB, SRGB, inPlace=True) + self.assert_image(i, "RGB", (128, 128)) + + t = ImageCms.buildTransform(SRGB, SRGB, "RGB", "RGB") + i = ImageCms.applyTransform(lena(), t) + self.assert_image(i, "RGB", (128, 128)) + + i = lena() + t = ImageCms.buildTransform(SRGB, SRGB, "RGB", "RGB") + ImageCms.applyTransform(lena(), t, inPlace=True) + self.assert_image(i, "RGB", (128, 128)) + + p = ImageCms.createProfile("sRGB") + o = ImageCms.getOpenProfile(SRGB) + t = ImageCms.buildTransformFromOpenProfiles(p, o, "RGB", "RGB") + i = ImageCms.applyTransform(lena(), t) + self.assert_image(i, "RGB", (128, 128)) + + t = ImageCms.buildProofTransform(SRGB, SRGB, SRGB, "RGB", "RGB") + self.assertEqual(t.inputMode, "RGB") + self.assertEqual(t.outputMode, "RGB") + i = ImageCms.applyTransform(lena(), t) + self.assert_image(i, "RGB", (128, 128)) + + # test PointTransform convenience API + lena().point(t) + + def test_name(self): + # get profile information for file + self.assertEqual( + ImageCms.getProfileName(SRGB).strip(), + 'IEC 61966-2.1 Default RGB colour space - sRGB') + + def test_info(self): + self.assertEqual( + ImageCms.getProfileInfo(SRGB).splitlines(), [ + 'sRGB IEC61966-2.1', '', + 'Copyright (c) 1998 Hewlett-Packard Company', '']) + + def test_copyright(self): + self.assertEqual( + ImageCms.getProfileCopyright(SRGB).strip(), + 'Copyright (c) 1998 Hewlett-Packard Company') + + def test_manufacturer(self): + self.assertEqual( + ImageCms.getProfileManufacturer(SRGB).strip(), + 'IEC http://www.iec.ch') + + def test_model(self): + self.assertEqual( + ImageCms.getProfileModel(SRGB).strip(), + 'IEC 61966-2.1 Default RGB colour space - sRGB') + + def test_description(self): + self.assertEqual( + ImageCms.getProfileDescription(SRGB).strip(), + 'sRGB IEC61966-2.1') + + def test_intent(self): + self.assertEqual(ImageCms.getDefaultIntent(SRGB), 0) + self.assertEqual(ImageCms.isIntentSupported( + SRGB, ImageCms.INTENT_ABSOLUTE_COLORIMETRIC, + ImageCms.DIRECTION_INPUT), 1) + + def test_profile_object(self): + # same, using profile object + p = ImageCms.createProfile("sRGB") + # self.assertEqual(ImageCms.getProfileName(p).strip(), + # 'sRGB built-in - (lcms internal)') + # self.assertEqual(ImageCms.getProfileInfo(p).splitlines(), + # ['sRGB built-in', '', 'WhitePoint : D65 (daylight)', '', '']) + self.assertEqual(ImageCms.getDefaultIntent(p), 0) + self.assertEqual(ImageCms.isIntentSupported( + p, ImageCms.INTENT_ABSOLUTE_COLORIMETRIC, + ImageCms.DIRECTION_INPUT), 1) + + def test_extensions(self): + # extensions + from io import BytesIO + i = Image.open("Tests/images/rgb.jpg") + p = ImageCms.getOpenProfile(BytesIO(i.info["icc_profile"])) + self.assertEqual( + ImageCms.getProfileName(p).strip(), + 'IEC 61966-2.1 Default RGB colour space - sRGB') + + def test_exceptions(self): + # the procedural pyCMS API uses PyCMSError for all sorts of errors + self.assertRaises( + ImageCms.PyCMSError, + lambda: ImageCms.profileToProfile(lena(), "foo", "bar")) + self.assertRaises( + ImageCms.PyCMSError, + lambda: ImageCms.buildTransform("foo", "bar", "RGB", "RGB")) + self.assertRaises( + ImageCms.PyCMSError, + lambda: ImageCms.getProfileName(None)) + self.assertRaises( + ImageCms.PyCMSError, + lambda: ImageCms.isIntentSupported(SRGB, None, None)) + + def test_display_profile(self): + # try fetching the profile for the current display device + ImageCms.get_display_profile() + + def test_lab_color_profile(self): + ImageCms.createProfile("LAB", 5000) + ImageCms.createProfile("LAB", 6500) + + def test_simple_lab(self): + i = Image.new('RGB', (10, 10), (128, 128, 128)) + + pLab = ImageCms.createProfile("LAB") + t = ImageCms.buildTransform(SRGB, pLab, "RGB", "LAB") + + i_lab = ImageCms.applyTransform(i, t) + + self.assertEqual(i_lab.mode, 'LAB') + + k = i_lab.getpixel((0, 0)) + # not a linear luminance map. so L != 128: + self.assertEqual(k, (137, 128, 128)) + + L = i_lab.getdata(0) + a = i_lab.getdata(1) + b = i_lab.getdata(2) + + self.assertEqual(list(L), [137] * 100) + self.assertEqual(list(a), [128] * 100) + self.assertEqual(list(b), [128] * 100) + + def test_lab_color(self): + pLab = ImageCms.createProfile("LAB") + t = ImageCms.buildTransform(SRGB, pLab, "RGB", "LAB") + # Need to add a type mapping for some PIL type to TYPE_Lab_8 in + # findLCMSType, and have that mapping work back to a PIL mode + # (likely RGB). + i = ImageCms.applyTransform(lena(), t) + self.assert_image(i, "LAB", (128, 128)) + + # i.save('temp.lab.tif') # visually verified vs PS. + + target = Image.open('Tests/images/lena.Lab.tif') + + self.assert_image_similar(i, target, 30) + + def test_lab_srgb(self): + pLab = ImageCms.createProfile("LAB") + t = ImageCms.buildTransform(pLab, SRGB, "LAB", "RGB") + + img = Image.open('Tests/images/lena.Lab.tif') + + img_srgb = ImageCms.applyTransform(img, t) + + # img_srgb.save('temp.srgb.tif') # visually verified vs ps. + + self.assert_image_similar(lena(), img_srgb, 30) + + def test_lab_roundtrip(self): + # check to see if we're at least internally consistent. + pLab = ImageCms.createProfile("LAB") + t = ImageCms.buildTransform(SRGB, pLab, "RGB", "LAB") + + t2 = ImageCms.buildTransform(pLab, SRGB, "LAB", "RGB") + + i = ImageCms.applyTransform(lena(), t) + out = ImageCms.applyTransform(i, t2) + + self.assert_image_similar(lena(), out, 2) + + +if __name__ == '__main__': + unittest.main() + +# End of file diff --git a/test/test_imagemode.py b/test/test_imagemode.py new file mode 100644 index 000000000..7fb596b46 --- /dev/null +++ b/test/test_imagemode.py @@ -0,0 +1,32 @@ +from helper import unittest, PillowTestCase + +from PIL import ImageMode + + +class TestImage(PillowTestCase): + + def test_sanity(self): + ImageMode.getmode("1") + ImageMode.getmode("L") + ImageMode.getmode("P") + ImageMode.getmode("RGB") + ImageMode.getmode("I") + ImageMode.getmode("F") + + m = ImageMode.getmode("1") + self.assertEqual(m.mode, "1") + self.assertEqual(m.bands, ("1",)) + self.assertEqual(m.basemode, "L") + self.assertEqual(m.basetype, "L") + + m = ImageMode.getmode("RGB") + self.assertEqual(m.mode, "RGB") + self.assertEqual(m.bands, ("R", "G", "B")) + self.assertEqual(m.basemode, "RGB") + self.assertEqual(m.basetype, "L") + + +if __name__ == '__main__': + unittest.main() + +# End of file diff --git a/test/test_imageshow.py b/test/test_imageshow.py new file mode 100644 index 000000000..12594c98f --- /dev/null +++ b/test/test_imageshow.py @@ -0,0 +1,18 @@ +from helper import unittest, PillowTestCase + +from PIL import Image +from PIL import ImageShow + + +class TestImage(PillowTestCase): + + def test_sanity(self): + dir(Image) + dir(ImageShow) + pass + + +if __name__ == '__main__': + unittest.main() + +# End of file diff --git a/test/test_imagetk.py b/test/test_imagetk.py new file mode 100644 index 000000000..87a07e288 --- /dev/null +++ b/test/test_imagetk.py @@ -0,0 +1,17 @@ +from helper import unittest, PillowTestCase + + +class TestImageTk(PillowTestCase): + + def test_import(self): + try: + from PIL import ImageTk + dir(ImageTk) + except (OSError, ImportError) as v: + self.skipTest(v) + + +if __name__ == '__main__': + unittest.main() + +# End of file diff --git a/test/test_imagewin.py b/test/test_imagewin.py new file mode 100644 index 000000000..f7a6bc0dc --- /dev/null +++ b/test/test_imagewin.py @@ -0,0 +1,18 @@ +from helper import unittest, PillowTestCase, lena + +from PIL import Image +from PIL import ImageWin + + +class TestImage(PillowTestCase): + + def test_sanity(self): + dir(Image) + dir(ImageShow) + pass + + +if __name__ == '__main__': + unittest.main() + +# End of file