Skip to content

Commit

Permalink
Refactor test
Browse files Browse the repository at this point in the history
  • Loading branch information
mondeja committed Jan 23, 2021
1 parent 6311351 commit 8b48fd6
Showing 1 changed file with 22 additions and 15 deletions.
37 changes: 22 additions & 15 deletions tests/test_fx.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,74 +503,81 @@ def test_resize():
@pytest.mark.parametrize(
(
"angle",
"expected_frames",
"translate",
"center",
"bg_color",
"expected_frames",
),
(
(
0,
[["AAAA", "BBBB", "CCCC"], ["ABCD", "BCDE", "CDEA"]],
None,
None,
None,
[["AAAA", "BBBB", "CCCC"], ["ABCD", "BCDE", "CDEA"]],
),
(
90,
[["ABC", "ABC", "ABC", "ABC"], ["DEA", "CDE", "BCD", "ABC"]],
None,
None,
(255, 0, 0),
[["ABC", "ABC", "ABC", "ABC"], ["DEA", "CDE", "BCD", "ABC"]],
),
(
180,
[["CCCC", "BBBB", "AAAA"], ["AEDC", "EDCB", "DCBA"]],
None,
None,
(0, 255, 0),
[["CCCC", "BBBB", "AAAA"], ["AEDC", "EDCB", "DCBA"]],
),
(
270,
[["CBA", "CBA", "CBA", "CBA"], ["CBA", "DCB", "EDC", "AED"]],
None,
None,
(0, 0, 255),
[["CBA", "CBA", "CBA", "CBA"], ["CBA", "DCB", "EDC", "AED"]],
),
(
45,
(50, 50),
None,
(0, 255, 0),
[
["GGGGGG", "GGGGGG", "GGGGGG", "GGGGGG", "GGGGGG", "GGGGGG"],
["GGGGGG", "GGGGGG", "GGGGGG", "GGGGGG", "GGGGGG", "GGGGGG"],
],
(50, 50),
None,
(0, 255, 0),
),
(
45,
(50, 50),
(20, 20),
(255, 0, 0),
[
["RRRRRR", "RRRRRR", "RRRRRR", "RRRRRR", "RRRRRR"],
["RRRRRR", "RRRRRR", "RRRRRR", "RRRRRR", "RRRRRR"],
],
(50, 50),
(20, 20),
(255, 0, 0),
),
(
135,
(-100, -100),
None,
(0, 0, 255),
[
["BBBBBB", "BBBBBB", "BBBBBB", "BBBBBB", "BBBBBB"],
["BBBBBB", "BBBBBB", "BBBBBB", "BBBBBB", "BBBBBB"],
],
(-100, -100),
None,
(0, 0, 255),
),
),
)
def test_rotate(
angle_offset, angle, expected_frames, unit, resample, translate, center, bg_color
angle_offset,
angle,
unit,
resample,
translate,
center,
bg_color,
expected_frames,
):
"""Check ``rotate`` FX behaviour against possible combinations of arguments."""
original_frames = [["AAAA", "BBBB", "CCCC"], ["ABCD", "BCDE", "CDEA"]]
Expand Down

0 comments on commit 8b48fd6

Please sign in to comment.