refactoring

This commit is contained in:
Matthias Bisping 2022-04-05 22:56:08 +02:00
parent 6e5d6912ed
commit 66fd103d1b

View File

@ -10,6 +10,10 @@ from test.conftest import get_base_position_metadata, add_image, random_single_c
from test.utils.stitching import BoxSplitter from test.utils.stitching import BoxSplitter
# def test_image_stitcher(patches_metadata):
# assert Stitcher().stitch(patches)
@pytest.mark.parametrize("width", [160]) @pytest.mark.parametrize("width", [160])
@pytest.mark.parametrize("height", [90]) @pytest.mark.parametrize("height", [90])
@pytest.mark.parametrize("page_width", [int(160 * 1.1)]) @pytest.mark.parametrize("page_width", [int(160 * 1.1)])
@ -31,8 +35,13 @@ def patch_image_metadata_pairs(patches_metadata):
@pytest.fixture @pytest.fixture
def patches_metadata(width, height, page_width, page_height): def base_patch_metadata(width, height, page_width, page_height):
metadata = get_base_position_metadata(width, height, page_width, page_height) metadata = get_base_position_metadata(width, height, page_width, page_height)
metadata = merge(metadata, {Info.X1: 0, Info.Y1: 0, Info.X2: width, Info.Y2: height}) metadata = merge(metadata, {Info.X1: 0, Info.Y1: 0, Info.X2: width, Info.Y2: height})
patches_metadata = BoxSplitter().split_box(metadata) return metadata
@pytest.fixture
def patches_metadata(base_patch_metadata):
patches_metadata = BoxSplitter().split_box(base_patch_metadata)
return patches_metadata return patches_metadata