mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-13 18:56:17 +03:00
Format with Black
This commit is contained in:
parent
1b99362f3d
commit
488a0170a3
|
@ -93,7 +93,7 @@ class TestFileIco(PillowTestCase):
|
||||||
outfile = self.tempfile("temp_saved_hopper_draw.ico")
|
outfile = self.tempfile("temp_saved_hopper_draw.ico")
|
||||||
|
|
||||||
draw = ImageDraw.Draw(im)
|
draw = ImageDraw.Draw(im)
|
||||||
draw.line((0, 0) + im.size, '#f00')
|
draw.line((0, 0) + im.size, "#f00")
|
||||||
im.save(outfile)
|
im.save(outfile)
|
||||||
|
|
||||||
im = Image.open(outfile)
|
im = Image.open(outfile)
|
||||||
|
|
|
@ -20,6 +20,7 @@ class TestImagePsd(PillowTestCase):
|
||||||
def open():
|
def open():
|
||||||
im = Image.open(test_file)
|
im = Image.open(test_file)
|
||||||
im.load()
|
im.load()
|
||||||
|
|
||||||
self.assert_warning(None, open)
|
self.assert_warning(None, open)
|
||||||
|
|
||||||
def test_invalid_file(self):
|
def test_invalid_file(self):
|
||||||
|
@ -72,7 +73,7 @@ class TestImagePsd(PillowTestCase):
|
||||||
def test_open_after_exclusive_load(self):
|
def test_open_after_exclusive_load(self):
|
||||||
im = Image.open(test_file)
|
im = Image.open(test_file)
|
||||||
im.load()
|
im.load()
|
||||||
im.seek(im.tell()+1)
|
im.seek(im.tell() + 1)
|
||||||
im.load()
|
im.load()
|
||||||
|
|
||||||
def test_icc_profile(self):
|
def test_icc_profile(self):
|
||||||
|
|
|
@ -25,10 +25,16 @@ class TestImageMode(PillowTestCase):
|
||||||
self.assertEqual(m.basemode, "L")
|
self.assertEqual(m.basemode, "L")
|
||||||
self.assertEqual(m.basetype, "L")
|
self.assertEqual(m.basetype, "L")
|
||||||
|
|
||||||
for mode in ("I;16", "I;16S",
|
for mode in (
|
||||||
"I;16L", "I;16LS",
|
"I;16",
|
||||||
"I;16B", "I;16BS",
|
"I;16S",
|
||||||
"I;16N", "I;16NS"):
|
"I;16L",
|
||||||
|
"I;16LS",
|
||||||
|
"I;16B",
|
||||||
|
"I;16BS",
|
||||||
|
"I;16N",
|
||||||
|
"I;16NS",
|
||||||
|
):
|
||||||
m = ImageMode.getmode(mode)
|
m = ImageMode.getmode(mode)
|
||||||
self.assertEqual(m.mode, mode)
|
self.assertEqual(m.mode, mode)
|
||||||
self.assertEqual(str(m), mode)
|
self.assertEqual(str(m), mode)
|
||||||
|
|
|
@ -102,15 +102,15 @@ class TestImagecomplextext(PillowTestCase):
|
||||||
def test_text_direction_ttb(self):
|
def test_text_direction_ttb(self):
|
||||||
ttf = ImageFont.truetype("Tests/fonts/NotoSansJP-Regular.otf", FONT_SIZE)
|
ttf = ImageFont.truetype("Tests/fonts/NotoSansJP-Regular.otf", FONT_SIZE)
|
||||||
|
|
||||||
im = Image.new(mode='RGB', size=(100, 300))
|
im = Image.new(mode="RGB", size=(100, 300))
|
||||||
draw = ImageDraw.Draw(im)
|
draw = ImageDraw.Draw(im)
|
||||||
try:
|
try:
|
||||||
draw.text((0, 0), 'English あい', font=ttf, fill=500, direction='ttb')
|
draw.text((0, 0), "English あい", font=ttf, fill=500, direction="ttb")
|
||||||
except ValueError as ex:
|
except ValueError as ex:
|
||||||
if str(ex) == "libraqm 0.7 or greater required for 'ttb' direction":
|
if str(ex) == "libraqm 0.7 or greater required for 'ttb' direction":
|
||||||
self.skipTest('libraqm 0.7 or greater not available')
|
self.skipTest("libraqm 0.7 or greater not available")
|
||||||
|
|
||||||
target = 'Tests/images/test_direction_ttb.png'
|
target = "Tests/images/test_direction_ttb.png"
|
||||||
target_img = Image.open(target)
|
target_img = Image.open(target)
|
||||||
|
|
||||||
self.assert_image_similar(im, target_img, 1.15)
|
self.assert_image_similar(im, target_img, 1.15)
|
||||||
|
|
|
@ -32,7 +32,7 @@ class TestImageSequence(PillowTestCase):
|
||||||
self.assertRaises(StopIteration, next, i)
|
self.assertRaises(StopIteration, next, i)
|
||||||
|
|
||||||
def test_iterator_min_frame(self):
|
def test_iterator_min_frame(self):
|
||||||
im = Image.open('Tests/images/hopper.psd')
|
im = Image.open("Tests/images/hopper.psd")
|
||||||
i = ImageSequence.Iterator(im)
|
i = ImageSequence.Iterator(im)
|
||||||
for index in range(1, im.n_frames):
|
for index in range(1, im.n_frames):
|
||||||
self.assertEqual(i[index], next(i))
|
self.assertEqual(i[index], next(i))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user