Fix typo: fihopperme -> filename

This commit is contained in:
hugovk 2014-09-15 08:59:28 +03:00
parent ba696ab7f8
commit bdf845d6df
3 changed files with 12 additions and 11 deletions

View File

@ -2,13 +2,13 @@ from helper import unittest, PillowTestCase, fromstring, tostring
from PIL import Image from PIL import Image
codecs = dir(Image.core) CODECS = dir(Image.core)
fihopperme = "Tests/images/hopper.jpg" FILENAME = "Tests/images/hopper.jpg"
data = tostring(Image.open(fihopperme).resize((512, 512)), "JPEG") DATA = tostring(Image.open(FILENAME).resize((512, 512)), "JPEG")
def draft(mode, size): def draft(mode, size):
im = fromstring(data) im = fromstring(DATA)
im.draft(mode, size) im.draft(mode, size)
return im return im
@ -16,7 +16,7 @@ def draft(mode, size):
class TestImageDraft(PillowTestCase): class TestImageDraft(PillowTestCase):
def setUp(self): def setUp(self):
if "jpeg_encoder" not in codecs or "jpeg_decoder" not in codecs: if "jpeg_encoder" not in CODECS or "jpeg_decoder" not in CODECS:
self.skipTest("jpeg support not available") self.skipTest("jpeg support not available")
def test_size(self): def test_size(self):

View File

@ -39,10 +39,10 @@ class TestModeI16(PillowTestCase):
imOut = imIn.transform((w, h), Image.EXTENT, (0, 0, w, h)) imOut = imIn.transform((w, h), Image.EXTENT, (0, 0, w, h))
self.verify(imOut) # transform self.verify(imOut) # transform
fihopperme = self.tempfile("temp.im") filename = self.tempfile("temp.im")
imIn.save(fihopperme) imIn.save(filename)
imOut = Image.open(fihopperme) imOut = Image.open(filename)
self.verify(imIn) self.verify(imIn)
self.verify(imOut) self.verify(imOut)

View File

@ -6,13 +6,14 @@ from PIL import Image
class TestPickle(PillowTestCase): class TestPickle(PillowTestCase):
def helper_pickle_file(self, pickle, protocol=0): def helper_pickle_file(self, pickle, protocol=0):
# Arrange
im = Image.open('Tests/images/hopper.jpg') im = Image.open('Tests/images/hopper.jpg')
fihopperme = self.tempfile('temp.pkl') filename = self.tempfile('temp.pkl')
# Act # Act
with open(fihopperme, 'wb') as f: with open(filename, 'wb') as f:
pickle.dump(im, f, protocol) pickle.dump(im, f, protocol)
with open(fihopperme, 'rb') as f: with open(filename, 'rb') as f:
loaded_im = pickle.load(f) loaded_im = pickle.load(f)
# Assert # Assert