mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 18:06:18 +03:00
Fixed redefined built-in
This commit is contained in:
parent
0b64d6d8bf
commit
1c99b39239
|
@ -24,13 +24,13 @@ class TestImageOpsUsm(PillowTestCase):
|
||||||
|
|
||||||
def test_filter_api(self):
|
def test_filter_api(self):
|
||||||
|
|
||||||
filter = ImageFilter.GaussianBlur(2.0)
|
test_filter = ImageFilter.GaussianBlur(2.0)
|
||||||
i = im.filter(filter)
|
i = im.filter(test_filter)
|
||||||
self.assertEqual(i.mode, "RGB")
|
self.assertEqual(i.mode, "RGB")
|
||||||
self.assertEqual(i.size, (128, 128))
|
self.assertEqual(i.size, (128, 128))
|
||||||
|
|
||||||
filter = ImageFilter.UnsharpMask(2.0, 125, 8)
|
test_filter = ImageFilter.UnsharpMask(2.0, 125, 8)
|
||||||
i = im.filter(filter)
|
i = im.filter(test_filter)
|
||||||
self.assertEqual(i.mode, "RGB")
|
self.assertEqual(i.mode, "RGB")
|
||||||
self.assertEqual(i.size, (128, 128))
|
self.assertEqual(i.size, (128, 128))
|
||||||
|
|
||||||
|
|
|
@ -22,9 +22,9 @@ class TestNumpy(PillowTestCase):
|
||||||
|
|
||||||
def test_numpy_to_image(self):
|
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 bands == 1:
|
||||||
if bool:
|
if boolean:
|
||||||
data = [0, 1] * 50
|
data = [0, 1] * 50
|
||||||
else:
|
else:
|
||||||
data = list(range(100))
|
data = list(range(100))
|
||||||
|
@ -43,8 +43,8 @@ class TestNumpy(PillowTestCase):
|
||||||
# print dtype, list(i.getdata())
|
# print dtype, list(i.getdata())
|
||||||
return i
|
return i
|
||||||
|
|
||||||
# self.assert_image(to_image(numpy.bool, bool=1), "1", (10, 10))
|
# self.assert_image(to_image(numpy.bool, boolean=1), "1", (10, 10))
|
||||||
# self.assert_image(to_image(numpy.bool8, bool=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.assertRaises(TypeError, lambda: to_image(numpy.uint))
|
||||||
self.assert_image(to_image(numpy.uint8), "L", (10, 10))
|
self.assert_image(to_image(numpy.uint8), "L", (10, 10))
|
||||||
|
|
|
@ -52,10 +52,10 @@ class TestOleFileIo(PillowTestCase):
|
||||||
ole = OleFileIO.OleFileIO(ole_file)
|
ole = OleFileIO.OleFileIO(ole_file)
|
||||||
|
|
||||||
# Act
|
# Act
|
||||||
type = ole.get_type('worddocument')
|
entry_type = ole.get_type('worddocument')
|
||||||
|
|
||||||
# Assert
|
# Assert
|
||||||
self.assertEqual(type, OleFileIO.STGTY_STREAM)
|
self.assertEqual(entry_type, OleFileIO.STGTY_STREAM)
|
||||||
ole.close()
|
ole.close()
|
||||||
|
|
||||||
def test_get_size(self):
|
def test_get_size(self):
|
||||||
|
|
|
@ -22,8 +22,8 @@ class TestPickle(PillowTestCase):
|
||||||
self.assertEqual(im, loaded_im)
|
self.assertEqual(im, loaded_im)
|
||||||
|
|
||||||
def helper_pickle_string(self, pickle, protocol=0,
|
def helper_pickle_string(self, pickle, protocol=0,
|
||||||
file='Tests/images/hopper.jpg', mode=None):
|
test_file='Tests/images/hopper.jpg', mode=None):
|
||||||
im = Image.open(file)
|
im = Image.open(test_file)
|
||||||
if mode:
|
if mode:
|
||||||
im = im.convert(mode)
|
im = im.convert(mode)
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ class TestPickle(PillowTestCase):
|
||||||
"Tests/images/p_trns_single.png",
|
"Tests/images/p_trns_single.png",
|
||||||
"Tests/images/pil123p.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):
|
def test_pickle_l_mode(self):
|
||||||
# Arrange
|
# Arrange
|
||||||
|
|
Loading…
Reference in New Issue
Block a user