Fixed redefined built-in

This commit is contained in:
Andrew Murray 2015-12-10 09:23:58 +11:00
parent 0b64d6d8bf
commit 1c99b39239
4 changed files with 13 additions and 13 deletions

View File

@ -24,13 +24,13 @@ class TestImageOpsUsm(PillowTestCase):
def test_filter_api(self):
filter = ImageFilter.GaussianBlur(2.0)
i = im.filter(filter)
test_filter = ImageFilter.GaussianBlur(2.0)
i = im.filter(test_filter)
self.assertEqual(i.mode, "RGB")
self.assertEqual(i.size, (128, 128))
filter = ImageFilter.UnsharpMask(2.0, 125, 8)
i = im.filter(filter)
test_filter = ImageFilter.UnsharpMask(2.0, 125, 8)
i = im.filter(test_filter)
self.assertEqual(i.mode, "RGB")
self.assertEqual(i.size, (128, 128))

View File

@ -22,9 +22,9 @@ class TestNumpy(PillowTestCase):
def test_numpy_to_image(self):
def to_image(dtype, bands=1, bool=0):
def to_image(dtype, bands=1, boolean=0):
if bands == 1:
if bool:
if boolean:
data = [0, 1] * 50
else:
data = list(range(100))
@ -43,8 +43,8 @@ class TestNumpy(PillowTestCase):
# print dtype, list(i.getdata())
return i
# self.assert_image(to_image(numpy.bool, bool=1), "1", (10, 10))
# self.assert_image(to_image(numpy.bool8, bool=1), "1", (10, 10))
# self.assert_image(to_image(numpy.bool, boolean=1), "1", (10, 10))
# self.assert_image(to_image(numpy.bool8, boolean=1), "1", (10, 10))
self.assertRaises(TypeError, lambda: to_image(numpy.uint))
self.assert_image(to_image(numpy.uint8), "L", (10, 10))

View File

@ -52,10 +52,10 @@ class TestOleFileIo(PillowTestCase):
ole = OleFileIO.OleFileIO(ole_file)
# Act
type = ole.get_type('worddocument')
entry_type = ole.get_type('worddocument')
# Assert
self.assertEqual(type, OleFileIO.STGTY_STREAM)
self.assertEqual(entry_type, OleFileIO.STGTY_STREAM)
ole.close()
def test_get_size(self):

View File

@ -22,8 +22,8 @@ class TestPickle(PillowTestCase):
self.assertEqual(im, loaded_im)
def helper_pickle_string(self, pickle, protocol=0,
file='Tests/images/hopper.jpg', mode=None):
im = Image.open(file)
test_file='Tests/images/hopper.jpg', mode=None):
im = Image.open(test_file)
if mode:
im = im.convert(mode)
@ -69,7 +69,7 @@ class TestPickle(PillowTestCase):
"Tests/images/p_trns_single.png",
"Tests/images/pil123p.png"
]:
self.helper_pickle_string(pickle, file=test_file)
self.helper_pickle_string(pickle, test_file=test_file)
def test_pickle_l_mode(self):
# Arrange