diff --git a/Tests/bench_cffi_access.py b/Tests/bench_cffi_access.py index 8aa322aff..769396f53 100644 --- a/Tests/bench_cffi_access.py +++ b/Tests/bench_cffi_access.py @@ -1,4 +1,4 @@ -from helper import * +from helper import unittest, PillowTestCase, hopper # Not running this test by default. No DOS against Travis CI. @@ -39,7 +39,7 @@ def timer(func, label, *args): class BenchCffiAccess(PillowTestCase): def test_direct(self): - im = lena() + im = hopper() im.load() # im = Image.new( "RGB", (2000, 2000), (1, 3, 2)) caccess = im.im.pixel_access(False) diff --git a/Tests/bench_get.py b/Tests/bench_get.py index 8a1331d39..8f786acf0 100644 --- a/Tests/bench_get.py +++ b/Tests/bench_get.py @@ -6,7 +6,7 @@ import timeit def bench(mode): - im = helper.lena(mode) + im = helper.hopper(mode) get = im.im.getpixel xy = 50, 50 # position shouldn't really matter t0 = timeit.default_timer() diff --git a/Tests/helper.py b/Tests/helper.py index 637e77f9c..34dafa645 100644 --- a/Tests/helper.py +++ b/Tests/helper.py @@ -191,11 +191,11 @@ def hopper(mode="RGB", cache={}): if mode == "RGB": im = Image.open("Tests/images/hopper.ppm") elif mode == "F": - im = lena("L").convert(mode) + im = hopper("L").convert(mode) elif mode[:4] == "I;16": - im = lena("I").convert(mode) + im = hopper("I").convert(mode) else: - im = lena("RGB").convert(mode) + im = hopper("RGB").convert(mode) # cache[mode] = im return im diff --git a/Tests/test_cffi.py b/Tests/test_cffi.py index b9f99976d..5599dbb48 100644 --- a/Tests/test_cffi.py +++ b/Tests/test_cffi.py @@ -1,4 +1,4 @@ -from helper import unittest, PillowTestCase, lena +from helper import unittest, PillowTestCase, hopper try: import cffi @@ -62,16 +62,16 @@ class TestCffi(PillowTestCase): self.assertEqual(access[(x, y)], caccess[(x, y)]) def test_get_vs_c(self): - rgb = lena('RGB') + rgb = hopper('RGB') rgb.load() self._test_get_access(rgb) - self._test_get_access(lena('RGBA')) - self._test_get_access(lena('L')) - self._test_get_access(lena('LA')) - self._test_get_access(lena('1')) - self._test_get_access(lena('P')) - # self._test_get_access(lena('PA')) # PA -- how do I make a PA image? - self._test_get_access(lena('F')) + self._test_get_access(hopper('RGBA')) + self._test_get_access(hopper('L')) + self._test_get_access(hopper('LA')) + self._test_get_access(hopper('1')) + self._test_get_access(hopper('P')) + # self._test_get_access(hopper('PA')) # PA -- how do I make a PA image? + self._test_get_access(hopper('F')) im = Image.new('I;16', (10, 10), 40000) self._test_get_access(im) @@ -104,16 +104,16 @@ class TestCffi(PillowTestCase): self.assertEqual(color, caccess[(x, y)]) def test_set_vs_c(self): - rgb = lena('RGB') + rgb = hopper('RGB') rgb.load() self._test_set_access(rgb, (255, 128, 0)) - self._test_set_access(lena('RGBA'), (255, 192, 128, 0)) - self._test_set_access(lena('L'), 128) - self._test_set_access(lena('LA'), (128, 128)) - self._test_set_access(lena('1'), 255) - self._test_set_access(lena('P'), 128) + self._test_set_access(hopper('RGBA'), (255, 192, 128, 0)) + self._test_set_access(hopper('L'), 128) + self._test_set_access(hopper('LA'), (128, 128)) + self._test_set_access(hopper('1'), 255) + self._test_set_access(hopper('P'), 128) # self._test_set_access(i, (128, 128)) #PA -- undone how to make - self._test_set_access(lena('F'), 1024.0) + self._test_set_access(hopper('F'), 1024.0) im = Image.new('I;16', (10, 10), 40000) self._test_set_access(im, 45000) diff --git a/Tests/test_decompression_bomb.py b/Tests/test_decompression_bomb.py index 0803732ce..ae9aebfa8 100644 --- a/Tests/test_decompression_bomb.py +++ b/Tests/test_decompression_bomb.py @@ -2,7 +2,7 @@ from helper import unittest, PillowTestCase from PIL import Image -test_file = "Tests/images/lena.ppm" +TEST_FILE = "Tests/images/hopper.ppm" ORIGINAL_LIMIT = Image.MAX_IMAGE_PIXELS @@ -15,7 +15,7 @@ class TestDecompressionBomb(PillowTestCase): def test_no_warning_small_file(self): # Implicit assert: no warning. # A warning would cause a failure. - Image.open(test_file) + Image.open(TEST_FILE) def test_no_warning_no_limit(self): # Arrange @@ -26,7 +26,7 @@ class TestDecompressionBomb(PillowTestCase): # Act / Assert # Implicit assert: no warning. # A warning would cause a failure. - Image.open(test_file) + Image.open(TEST_FILE) def test_warning(self): # Arrange @@ -37,7 +37,7 @@ class TestDecompressionBomb(PillowTestCase): # Act / Assert self.assert_warning( Image.DecompressionBombWarning, - lambda: Image.open(test_file)) + lambda: Image.open(TEST_FILE)) if __name__ == '__main__': unittest.main() diff --git a/Tests/test_file_bmp.py b/Tests/test_file_bmp.py index e04f3642c..69792fe12 100644 --- a/Tests/test_file_bmp.py +++ b/Tests/test_file_bmp.py @@ -1,4 +1,4 @@ -from helper import unittest, PillowTestCase, lena +from helper import unittest, PillowTestCase, hopper from PIL import Image import io @@ -18,16 +18,16 @@ class TestFileBmp(PillowTestCase): self.assertEqual(reloaded.format, "BMP") def test_sanity(self): - self.roundtrip(lena()) + self.roundtrip(hopper()) - self.roundtrip(lena("1")) - self.roundtrip(lena("L")) - self.roundtrip(lena("P")) - self.roundtrip(lena("RGB")) + self.roundtrip(hopper("1")) + self.roundtrip(hopper("L")) + self.roundtrip(hopper("P")) + self.roundtrip(hopper("RGB")) def test_save_to_bytes(self): output = io.BytesIO() - im = lena() + im = hopper() im.save(output, "BMP") output.seek(0) @@ -41,7 +41,7 @@ class TestFileBmp(PillowTestCase): dpi = (72, 72) output = io.BytesIO() - im = lena() + im = hopper() im.save(output, "BMP", dpi=dpi) output.seek(0) diff --git a/Tests/test_file_iptc.py b/Tests/test_file_iptc.py index bd331e5b2..14eb135aa 100644 --- a/Tests/test_file_iptc.py +++ b/Tests/test_file_iptc.py @@ -1,4 +1,4 @@ -from helper import unittest, PillowTestCase, lena +from helper import unittest, PillowTestCase, hopper from PIL import Image, IptcImagePlugin @@ -21,7 +21,7 @@ class TestFileIptc(PillowTestCase): def test_getiptcinfo_jpg_none(self): # Arrange - im = lena() + im = hopper() # Act iptc = IptcImagePlugin.getiptcinfo(im) diff --git a/Tests/test_file_msp.py b/Tests/test_file_msp.py index a64faad10..c080247a0 100644 --- a/Tests/test_file_msp.py +++ b/Tests/test_file_msp.py @@ -1,4 +1,4 @@ -from helper import unittest, PillowTestCase, lena +from helper import unittest, PillowTestCase, hopper from PIL import Image @@ -9,7 +9,7 @@ class TestFileMsp(PillowTestCase): file = self.tempfile("temp.msp") - lena("1").save(file) + hopper("1").save(file) im = Image.open(file) im.load() diff --git a/Tests/test_file_palm.py b/Tests/test_file_palm.py index 388df0237..7af3e16bd 100644 --- a/Tests/test_file_palm.py +++ b/Tests/test_file_palm.py @@ -1,14 +1,14 @@ -from helper import unittest, PillowTestCase, lena, imagemagick_available +from helper import unittest, PillowTestCase, hopper, imagemagick_available import os.path class TestFilePalm(PillowTestCase): _roundtrip = imagemagick_available() - + def helper_save_as_palm(self, mode): # Arrange - im = lena(mode) + im = hopper(mode) outfile = self.tempfile("temp_" + mode + ".palm") # Act @@ -21,14 +21,14 @@ class TestFilePalm(PillowTestCase): def roundtrip(self, mode): if not self._roundtrip: return - - im = lena(mode) + + im = hopper(mode) outfile = self.tempfile("temp.palm") im.save(outfile) converted = self.open_withImagemagick(outfile) self.assert_image_equal(converted, im) - + def test_monochrome(self): # Arrange @@ -46,7 +46,7 @@ class TestFilePalm(PillowTestCase): self.helper_save_as_palm(mode) self.skipKnownBadTest("Palm P image is wrong") self.roundtrip(mode) - + def test_rgb_ioerror(self): # Arrange mode = "RGB" diff --git a/Tests/test_file_pcx.py b/Tests/test_file_pcx.py index f278bd91d..36d6e0315 100644 --- a/Tests/test_file_pcx.py +++ b/Tests/test_file_pcx.py @@ -1,4 +1,4 @@ -from helper import unittest, PillowTestCase, lena +from helper import unittest, PillowTestCase, hopper from PIL import Image @@ -17,7 +17,7 @@ class TestFilePcx(PillowTestCase): def test_sanity(self): for mode in ('1', 'L', 'P', 'RGB'): - self._roundtrip(lena(mode)) + self._roundtrip(hopper(mode)) def test_odd(self): # see issue #523, odd sized images should have a stride that's even. @@ -26,7 +26,7 @@ class TestFilePcx(PillowTestCase): for mode in ('1', 'L', 'P', 'RGB'): # larger, odd sized images are better here to ensure that # we handle interrupted scan lines properly. - self._roundtrip(lena(mode).resize((511, 511))) + self._roundtrip(hopper(mode).resize((511, 511))) def test_pil184(self): # Check reading of files where xmin/xmax is not zero. diff --git a/Tests/test_file_pdf.py b/Tests/test_file_pdf.py index 689302bb5..9424bc09d 100644 --- a/Tests/test_file_pdf.py +++ b/Tests/test_file_pdf.py @@ -1,4 +1,4 @@ -from helper import unittest, PillowTestCase, lena +from helper import unittest, PillowTestCase, hopper import os.path @@ -7,7 +7,7 @@ class TestFilePdf(PillowTestCase): def helper_save_as_pdf(self, mode): # Arrange - im = lena(mode) + im = hopper(mode) outfile = self.tempfile("temp_" + mode + ".pdf") # Act diff --git a/Tests/test_file_ppm.py b/Tests/test_file_ppm.py index e1f1537d2..3731fd9b1 100644 --- a/Tests/test_file_ppm.py +++ b/Tests/test_file_ppm.py @@ -3,7 +3,7 @@ from helper import unittest, PillowTestCase from PIL import Image # sample ppm stream -file = "Tests/images/lena.ppm" +file = "Tests/images/hopper.ppm" data = open(file, "rb").read() diff --git a/Tests/test_file_tiff.py b/Tests/test_file_tiff.py index 464f1c314..cf809d5d0 100644 --- a/Tests/test_file_tiff.py +++ b/Tests/test_file_tiff.py @@ -1,4 +1,4 @@ -from helper import unittest, PillowTestCase, lena, py3 +from helper import unittest, PillowTestCase, hopper, py3 from PIL import Image, TiffImagePlugin @@ -9,7 +9,7 @@ class TestFileTiff(PillowTestCase): file = self.tempfile("temp.tif") - lena("RGB").save(file) + hopper("RGB").save(file) im = Image.open(file) im.load() @@ -17,19 +17,19 @@ class TestFileTiff(PillowTestCase): self.assertEqual(im.size, (128, 128)) self.assertEqual(im.format, "TIFF") - lena("1").save(file) + hopper("1").save(file) im = Image.open(file) - lena("L").save(file) + hopper("L").save(file) im = Image.open(file) - lena("P").save(file) + hopper("P").save(file) im = Image.open(file) - lena("RGB").save(file) + hopper("RGB").save(file) im = Image.open(file) - lena("I").save(file) + hopper("I").save(file) im = Image.open(file) def test_mac_tiff(self): @@ -158,14 +158,14 @@ class TestFileTiff(PillowTestCase): im.seek(2) im.load() self.assertEqual(im.size, (20,20)) - self.assertEqual(im.convert('RGB').getpixel((0,0)), (0,0,255)) + self.assertEqual(im.convert('RGB').getpixel((0,0)), (0,0,255)) def test_multipage_last_frame(self): im = Image.open('Tests/images/multipage-lastframe.tif') im.load() self.assertEqual(im.size, (20,20)) - self.assertEqual(im.convert('RGB').getpixel((0,0)), (0,0,255)) - + self.assertEqual(im.convert('RGB').getpixel((0,0)), (0,0,255)) + def test___str__(self): # Arrange diff --git a/Tests/test_file_webp_alpha.py b/Tests/test_file_webp_alpha.py index 5f8f653cf..d6c5be450 100644 --- a/Tests/test_file_webp_alpha.py +++ b/Tests/test_file_webp_alpha.py @@ -1,4 +1,4 @@ -from helper import unittest, PillowTestCase, lena +from helper import unittest, PillowTestCase, hopper from PIL import Image @@ -40,7 +40,7 @@ class TestFileWebpAlpha(PillowTestCase): temp_file = self.tempfile("temp.webp") # temp_file = "temp.webp" - pil_image = lena('RGBA') + pil_image = hopper('RGBA') mask = Image.new("RGBA", (64, 64), (128, 128, 128, 128)) # Add some partially transparent bits: diff --git a/Tests/test_file_webp_lossless.py b/Tests/test_file_webp_lossless.py index 662ad1117..52a461a74 100644 --- a/Tests/test_file_webp_lossless.py +++ b/Tests/test_file_webp_lossless.py @@ -1,4 +1,4 @@ -from helper import unittest, PillowTestCase, lena +from helper import unittest, PillowTestCase, hopper from PIL import Image @@ -23,7 +23,7 @@ class TestFileWebpLossless(PillowTestCase): def test_write_lossless_rgb(self): temp_file = self.tempfile("temp.webp") - lena("RGB").save(temp_file, lossless=True) + hopper("RGB").save(temp_file, lossless=True) image = Image.open(temp_file) image.load() @@ -34,7 +34,7 @@ class TestFileWebpLossless(PillowTestCase): image.load() image.getdata() - self.assert_image_equal(image, lena("RGB")) + self.assert_image_equal(image, hopper("RGB")) if __name__ == '__main__': diff --git a/Tests/test_imagechops.py b/Tests/test_imagechops.py index 552314fd1..a3b7fa606 100644 --- a/Tests/test_imagechops.py +++ b/Tests/test_imagechops.py @@ -1,4 +1,4 @@ -from helper import unittest, PillowTestCase, lena +from helper import unittest, PillowTestCase, hopper from PIL import Image from PIL import ImageChops @@ -8,7 +8,7 @@ class TestImageChops(PillowTestCase): def test_sanity(self): - im = lena("L") + im = hopper("L") ImageChops.constant(im, 128) ImageChops.duplicate(im) diff --git a/Tests/test_imagedraw.py b/Tests/test_imagedraw.py index b632da73b..76e49deb4 100644 --- a/Tests/test_imagedraw.py +++ b/Tests/test_imagedraw.py @@ -1,4 +1,4 @@ -from helper import unittest, PillowTestCase, lena +from helper import unittest, PillowTestCase, hopper from PIL import Image from PIL import ImageColor @@ -34,7 +34,7 @@ POINTS2 = [10, 10, 20, 40, 30, 30] class TestImageDraw(PillowTestCase): def test_sanity(self): - im = lena("RGB").copy() + im = hopper("RGB").copy() draw = ImageDraw.ImageDraw(im) draw = ImageDraw.Draw(im) @@ -45,7 +45,7 @@ class TestImageDraw(PillowTestCase): draw.rectangle(list(range(4))) def test_deprecated(self): - im = lena().copy() + im = hopper().copy() draw = ImageDraw.Draw(im) diff --git a/Tests/test_imageenhance.py b/Tests/test_imageenhance.py index 433c49cf6..5edf46b12 100644 --- a/Tests/test_imageenhance.py +++ b/Tests/test_imageenhance.py @@ -1,4 +1,4 @@ -from helper import unittest, PillowTestCase, lena +from helper import unittest, PillowTestCase, hopper from PIL import Image from PIL import ImageEnhance @@ -10,10 +10,10 @@ class TestImageEnhance(PillowTestCase): # FIXME: assert_image # Implicit asserts no exception: - ImageEnhance.Color(lena()).enhance(0.5) - ImageEnhance.Contrast(lena()).enhance(0.5) - ImageEnhance.Brightness(lena()).enhance(0.5) - ImageEnhance.Sharpness(lena()).enhance(0.5) + ImageEnhance.Color(hopper()).enhance(0.5) + ImageEnhance.Contrast(hopper()).enhance(0.5) + ImageEnhance.Brightness(hopper()).enhance(0.5) + ImageEnhance.Sharpness(hopper()).enhance(0.5) def test_crash(self):