mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-15 01:34:45 +03:00
auto-formatting
This commit is contained in:
parent
05f78ca4db
commit
6aa7a7edd0
|
@ -531,7 +531,9 @@ class TestImage:
|
||||||
px = im.load()
|
px = im.load()
|
||||||
assert px[0, 0] == 5
|
assert px[0, 0] == 5
|
||||||
|
|
||||||
@pytest.mark.parametrize("wrong_mode", [
|
@pytest.mark.parametrize(
|
||||||
|
"wrong_mode",
|
||||||
|
[
|
||||||
"bad",
|
"bad",
|
||||||
"I;16N",
|
"I;16N",
|
||||||
# "LAB",
|
# "LAB",
|
||||||
|
@ -539,12 +541,15 @@ class TestImage:
|
||||||
"BGR;16",
|
"BGR;16",
|
||||||
"BGR;24",
|
"BGR;24",
|
||||||
"BGR;32",
|
"BGR;32",
|
||||||
])
|
],
|
||||||
|
)
|
||||||
def test_linear_gradient_wrong_mode(self, wrong_mode):
|
def test_linear_gradient_wrong_mode(self, wrong_mode):
|
||||||
with pytest.raises(ValueError):
|
with pytest.raises(ValueError):
|
||||||
Image.linear_gradient(wrong_mode)
|
Image.linear_gradient(wrong_mode)
|
||||||
|
|
||||||
@pytest.mark.parametrize("mode,pixel_a,pixel_b", [
|
@pytest.mark.parametrize(
|
||||||
|
"mode,pixel_a,pixel_b",
|
||||||
|
[
|
||||||
("1", 0, 255),
|
("1", 0, 255),
|
||||||
("P", 0, 255),
|
("P", 0, 255),
|
||||||
("PA", (0, 255), (255, 255)),
|
("PA", (0, 255), (255, 255)),
|
||||||
|
@ -563,7 +568,8 @@ class TestImage:
|
||||||
("CMYK", (0, 0, 0, 255), (0, 0, 0, 0)),
|
("CMYK", (0, 0, 0, 255), (0, 0, 0, 0)),
|
||||||
("YCbCr", (0, 128, 128), (255, 128, 128)),
|
("YCbCr", (0, 128, 128), (255, 128, 128)),
|
||||||
("HSV", (0, 0, 0), (0, 0, 255)),
|
("HSV", (0, 0, 0), (0, 0, 255)),
|
||||||
])
|
],
|
||||||
|
)
|
||||||
def test_linear_gradient(self, mode, pixel_a, pixel_b):
|
def test_linear_gradient(self, mode, pixel_a, pixel_b):
|
||||||
# Arrange
|
# Arrange
|
||||||
target_file = "Tests/images/linear_gradient.png"
|
target_file = "Tests/images/linear_gradient.png"
|
||||||
|
@ -580,7 +586,9 @@ class TestImage:
|
||||||
target = target.convert(mode, dither=0)
|
target = target.convert(mode, dither=0)
|
||||||
assert_image_equal(im, target)
|
assert_image_equal(im, target)
|
||||||
|
|
||||||
@pytest.mark.parametrize("wrong_mode", [
|
@pytest.mark.parametrize(
|
||||||
|
"wrong_mode",
|
||||||
|
[
|
||||||
"bad",
|
"bad",
|
||||||
"I;16N",
|
"I;16N",
|
||||||
# "LAB",
|
# "LAB",
|
||||||
|
@ -588,12 +596,15 @@ class TestImage:
|
||||||
"BGR;16",
|
"BGR;16",
|
||||||
"BGR;24",
|
"BGR;24",
|
||||||
"BGR;32",
|
"BGR;32",
|
||||||
])
|
],
|
||||||
|
)
|
||||||
def test_radial_gradient_wrong_mode(self, wrong_mode):
|
def test_radial_gradient_wrong_mode(self, wrong_mode):
|
||||||
with pytest.raises(ValueError):
|
with pytest.raises(ValueError):
|
||||||
Image.radial_gradient(wrong_mode)
|
Image.radial_gradient(wrong_mode)
|
||||||
|
|
||||||
@pytest.mark.parametrize("mode,pixel_a,pixel_b", [
|
@pytest.mark.parametrize(
|
||||||
|
"mode,pixel_a,pixel_b",
|
||||||
|
[
|
||||||
("1", 255, 0),
|
("1", 255, 0),
|
||||||
("P", 255, 0),
|
("P", 255, 0),
|
||||||
("PA", (255, 255), (0, 255)),
|
("PA", (255, 255), (0, 255)),
|
||||||
|
@ -612,7 +623,8 @@ class TestImage:
|
||||||
("CMYK", (0, 0, 0, 0), (0, 0, 0, 255)),
|
("CMYK", (0, 0, 0, 0), (0, 0, 0, 255)),
|
||||||
("YCbCr", (255, 128, 128), (0, 128, 128)),
|
("YCbCr", (255, 128, 128), (0, 128, 128)),
|
||||||
("HSV", (0, 0, 255), (0, 0, 0)),
|
("HSV", (0, 0, 255), (0, 0, 0)),
|
||||||
])
|
],
|
||||||
|
)
|
||||||
def test_radial_gradient(self, mode, pixel_a, pixel_b):
|
def test_radial_gradient(self, mode, pixel_a, pixel_b):
|
||||||
# Arrange
|
# Arrange
|
||||||
target_file = "Tests/images/radial_gradient.png"
|
target_file = "Tests/images/radial_gradient.png"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user