From 8cda42ab0a8fa0cf20c5e2cdd5fbb919726e0d91 Mon Sep 17 00:00:00 2001 From: skunkworxdark Date: Fri, 8 Dec 2023 18:17:40 +0000 Subject: [PATCH] ruff formatting --- tests/backend/tiles/test_tiles.py | 44 ++++++++++++++++++++++++------- 1 file changed, 35 insertions(+), 9 deletions(-) diff --git a/tests/backend/tiles/test_tiles.py b/tests/backend/tiles/test_tiles.py index a930f2f829..0f8998f7ed 100644 --- a/tests/backend/tiles/test_tiles.py +++ b/tests/backend/tiles/test_tiles.py @@ -168,12 +168,21 @@ def test_calc_tiles_min_overlap_difficult_size(): Tile(coords=TBLR(top=0, bottom=512, left=488, right=1000), overlap=TBLR(top=0, bottom=268, left=268, right=0)), # Row 1 Tile(coords=TBLR(top=244, bottom=756, left=0, right=512), overlap=TBLR(top=268, bottom=268, left=0, right=0)), - Tile(coords=TBLR(top=244, bottom=756, left=244, right=756),overlap=TBLR(top=268, bottom=268, left=268, right=268)), - Tile(coords=TBLR(top=244, bottom=756, left=488, right=1000), overlap=TBLR(top=268, bottom=268, left=268, right=0)), + Tile( + coords=TBLR(top=244, bottom=756, left=244, right=756), + overlap=TBLR(top=268, bottom=268, left=268, right=268), + ), + Tile( + coords=TBLR(top=244, bottom=756, left=488, right=1000), overlap=TBLR(top=268, bottom=268, left=268, right=0) + ), # Row 2 Tile(coords=TBLR(top=488, bottom=1000, left=0, right=512), overlap=TBLR(top=268, bottom=0, left=0, right=268)), - Tile(coords=TBLR(top=488, bottom=1000, left=244, right=756),overlap=TBLR(top=268, bottom=0, left=268, right=268)), - Tile(coords=TBLR(top=488, bottom=1000, left=488, right=1000), overlap=TBLR(top=268, bottom=0, left=268, right=0)), + Tile( + coords=TBLR(top=488, bottom=1000, left=244, right=756), overlap=TBLR(top=268, bottom=0, left=268, right=268) + ), + Tile( + coords=TBLR(top=488, bottom=1000, left=488, right=1000), overlap=TBLR(top=268, bottom=0, left=268, right=0) + ), ] assert tiles == expected_tiles @@ -193,12 +202,21 @@ def test_calc_tiles_min_overlap_difficult_size_div8(): Tile(coords=TBLR(top=0, bottom=512, left=488, right=1000), overlap=TBLR(top=0, bottom=272, left=264, right=0)), # Row 1 Tile(coords=TBLR(top=240, bottom=752, left=0, right=512), overlap=TBLR(top=272, bottom=264, left=0, right=272)), - Tile(coords=TBLR(top=240, bottom=752, left=240, right=752),overlap=TBLR(top=272, bottom=264, left=272, right=264)), - Tile(coords=TBLR(top=240, bottom=752, left=488, right=1000), overlap=TBLR(top=272, bottom=264, left=264, right=0)), + Tile( + coords=TBLR(top=240, bottom=752, left=240, right=752), + overlap=TBLR(top=272, bottom=264, left=272, right=264), + ), + Tile( + coords=TBLR(top=240, bottom=752, left=488, right=1000), overlap=TBLR(top=272, bottom=264, left=264, right=0) + ), # Row 2 Tile(coords=TBLR(top=488, bottom=1000, left=0, right=512), overlap=TBLR(top=264, bottom=0, left=0, right=272)), - Tile(coords=TBLR(top=488, bottom=1000, left=240, right=752),overlap=TBLR(top=264, bottom=0, left=272, right=264)), - Tile(coords=TBLR(top=488, bottom=1000, left=488, right=1000), overlap=TBLR(top=264, bottom=0, left=264, right=0)), + Tile( + coords=TBLR(top=488, bottom=1000, left=240, right=752), overlap=TBLR(top=264, bottom=0, left=272, right=264) + ), + Tile( + coords=TBLR(top=488, bottom=1000, left=488, right=1000), overlap=TBLR(top=264, bottom=0, left=264, right=0) + ), ] assert tiles == expected_tiles @@ -217,7 +235,13 @@ def test_calc_tiles_min_overlap_difficult_size_div8(): ], ) def test_calc_tiles_min_overlap_input_validation( - image_height: int, image_width: int, tile_height: int, tile_width: int, min_overlap: int, round_to_8: bool , raises: bool + image_height: int, + image_width: int, + tile_height: int, + tile_width: int, + min_overlap: int, + round_to_8: bool, + raises: bool, ): """Test that calc_tiles_with_overlap() raises an exception if the inputs are invalid.""" if raises: @@ -226,6 +250,7 @@ def test_calc_tiles_min_overlap_input_validation( else: calc_tiles_min_overlap(image_height, image_width, tile_height, tile_width, min_overlap, round_to_8) + #################################### # Test calc_tiles_even_split(...) #################################### @@ -301,6 +326,7 @@ def test_calc_tiles_even_split_difficult_size(): assert tiles == expected_tiles + @pytest.mark.parametrize( ["image_height", "image_width", "num_tiles_x", "num_tiles_y", "overlap", "raises"], [