refactoring: rename test_image to image to avoid tests

This commit is contained in:
Roman Inflianskas 2014-09-14 14:59:16 +04:00
parent 4ea0ff7118
commit 51fabf8bcf

View File

@ -180,7 +180,7 @@ def tostring(im, format, **options):
return out.getvalue() return out.getvalue()
def test_image(filename, mode="RGB", cache={}): def image(filename, mode="RGB", cache={}):
from PIL import Image from PIL import Image
from os import path from os import path
im = None im = None
@ -192,21 +192,21 @@ def test_image(filename, mode="RGB", cache={}):
if mode == "RGB": if mode == "RGB":
im = Image.open(path.join("Tests/images", filename)) im = Image.open(path.join("Tests/images", filename))
elif mode == "F": elif mode == "F":
im = test_image(filename, "L").convert(mode) im = image(filename, "L").convert(mode)
elif mode[:4] == "I;16": elif mode[:4] == "I;16":
im = test_image(filename, "I").convert(mode) im = image(filename, "I").convert(mode)
else: else:
im = test_image(filename, "RGB").convert(mode) im = image(filename, "RGB").convert(mode)
# cache[mode] = im # cache[mode] = im
return im return im
def hopper(mode="RGB", cache={}): def hopper(mode="RGB", cache={}):
return test_image("hopper.ppm", mode, cache) return image("hopper.ppm", mode, cache)
def lena(mode="RGB", cache={}): def lena(mode="RGB", cache={}):
return test_image("lena.ppm", mode, cache) return image("lena.ppm", mode, cache)
def command_succeeds(cmd): def command_succeeds(cmd):