Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Aug 22, 2022
1 parent fd47eed commit 1421f94
Showing 1 changed file with 88 additions and 55 deletions.
143 changes: 88 additions & 55 deletions Tests/test_image_paste.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,14 @@ def gradient_RGBa(self):
],
)

@pytest.mark.parametrize("mode", [
"RGBA",
"RGB",
"L",
])
@pytest.mark.parametrize(
"mode",
[
"RGBA",
"RGB",
"L",
],
)
def test_image_solid(self, mode):
im = Image.new(mode, (200, 200), "red")
im2 = getattr(self, "gradient_" + mode)
Expand All @@ -117,11 +120,14 @@ def test_image_solid(self, mode):
im = im.crop((12, 23, im2.width + 12, im2.height + 23))
assert_image_equal(im, im2)

@pytest.mark.parametrize("mode", [
"RGBA",
"RGB",
"L",
])
@pytest.mark.parametrize(
"mode",
[
"RGBA",
"RGB",
"L",
],
)
def test_image_mask_1(self, mode):
im = Image.new(mode, (200, 200), "white")
im2 = getattr(self, "gradient_" + mode)
Expand All @@ -143,11 +149,14 @@ def test_image_mask_1(self, mode):
],
)

@pytest.mark.parametrize("mode", [
"RGBA",
"RGB",
"L",
])
@pytest.mark.parametrize(
"mode",
[
"RGBA",
"RGB",
"L",
],
)
def test_image_mask_L(self, mode):
im = Image.new(mode, (200, 200), "white")
im2 = getattr(self, "gradient_" + mode)
Expand All @@ -169,11 +178,14 @@ def test_image_mask_L(self, mode):
],
)

@pytest.mark.parametrize("mode", [
"RGBA",
"RGB",
"L",
])
@pytest.mark.parametrize(
"mode",
[
"RGBA",
"RGB",
"L",
],
)
def test_image_mask_LA(self, mode):
im = Image.new(mode, (200, 200), "white")
im2 = getattr(self, "gradient_" + mode)
Expand All @@ -195,11 +207,14 @@ def test_image_mask_LA(self, mode):
],
)

@pytest.mark.parametrize("mode", [
"RGBA",
"RGB",
"L",
])
@pytest.mark.parametrize(
"mode",
[
"RGBA",
"RGB",
"L",
],
)
def test_image_mask_RGBA(self, mode):
im = Image.new(mode, (200, 200), "white")
im2 = getattr(self, "gradient_" + mode)
Expand All @@ -221,11 +236,14 @@ def test_image_mask_RGBA(self, mode):
],
)

@pytest.mark.parametrize("mode", [
"RGBA",
"RGB",
"L",
])
@pytest.mark.parametrize(
"mode",
[
"RGBA",
"RGB",
"L",
],
)
def test_image_mask_RGBa(self, mode):
im = Image.new(mode, (200, 200), "white")
im2 = getattr(self, "gradient_" + mode)
Expand All @@ -247,11 +265,14 @@ def test_image_mask_RGBa(self, mode):
],
)

@pytest.mark.parametrize("mode", [
"RGBA",
"RGB",
"L",
])
@pytest.mark.parametrize(
"mode",
[
"RGBA",
"RGB",
"L",
],
)
def test_color_solid(self, mode):
im = Image.new(mode, (200, 200), "black")

Expand All @@ -264,11 +285,14 @@ def test_color_solid(self, mode):
assert head[255] == 128 * 128
assert sum(head[:255]) == 0

@pytest.mark.parametrize("mode", [
"RGBA",
"RGB",
"L",
])
@pytest.mark.parametrize(
"mode",
[
"RGBA",
"RGB",
"L",
],
)
def test_color_mask_1(self, mode):
im = Image.new(mode, (200, 200), (50, 60, 70, 80)[: len(mode)])
color = (10, 20, 30, 40)[: len(mode)]
Expand All @@ -290,11 +314,14 @@ def test_color_mask_1(self, mode):
],
)

@pytest.mark.parametrize("mode", [
"RGBA",
"RGB",
"L",
])
@pytest.mark.parametrize(
"mode",
[
"RGBA",
"RGB",
"L",
],
)
def test_color_mask_L(self, mode):
im = getattr(self, "gradient_" + mode).copy()
color = "white"
Expand All @@ -316,11 +343,14 @@ def test_color_mask_L(self, mode):
],
)

@pytest.mark.parametrize("mode", [
"RGBA",
"RGB",
"L",
])
@pytest.mark.parametrize(
"mode",
[
"RGBA",
"RGB",
"L",
],
)
def test_color_mask_RGBA(self, mode):
im = getattr(self, "gradient_" + mode).copy()
color = "white"
Expand All @@ -342,11 +372,14 @@ def test_color_mask_RGBA(self, mode):
],
)

@pytest.mark.parametrize("mode", [
"RGBA",
"RGB",
"L",
])
@pytest.mark.parametrize(
"mode",
[
"RGBA",
"RGB",
"L",
],
)
def test_color_mask_RGBa(self, mode):
im = getattr(self, "gradient_" + mode).copy()
color = "white"
Expand Down

0 comments on commit 1421f94

Please sign in to comment.