diff --git a/test/conftest.py b/test/conftest.py index 23add8c..2db64b4 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -2,7 +2,6 @@ import logging import pytest -from image_prediction.info import Info from image_prediction.utils import get_logger pytest_plugins = [ @@ -26,10 +25,3 @@ def mute_logger(): logger.setLevel(logging.CRITICAL + 1) yield logger.setLevel(level) - - -@pytest.fixture -def info_label_map(): - return Info - - diff --git a/test/fixtures/metadata.py b/test/fixtures/metadata.py index 7cd2b9f..8440e24 100644 --- a/test/fixtures/metadata.py +++ b/test/fixtures/metadata.py @@ -8,7 +8,7 @@ from test.utils.metadata import get_base_position_metadata @pytest.fixture -def metadata(images, info_label_map): +def metadata(images): page_idx = 0 def current_page_idx(): @@ -25,16 +25,16 @@ def metadata(images, info_label_map): y1 = random.randint(0, page_height - height) y2 = y1 + height metadata = { - info_label_map.PAGE_WIDTH: page_width, - info_label_map.PAGE_HEIGHT: page_height, - info_label_map.PAGE_IDX: current_page_idx(), - info_label_map.WIDTH: width, - info_label_map.HEIGHT: height, - info_label_map.X1: x1, - info_label_map.X2: x2, - info_label_map.Y1: y1, - info_label_map.Y2: y2, - info_label_map.ALPHA: image.mode == "RGBA", + Info.PAGE_WIDTH: page_width, + Info.PAGE_HEIGHT: page_height, + Info.PAGE_IDX: current_page_idx(), + Info.WIDTH: width, + Info.HEIGHT: height, + Info.X1: x1, + Info.X2: x2, + Info.Y1: y1, + Info.Y2: y2, + Info.ALPHA: image.mode == "RGBA", } return metadata @@ -53,4 +53,4 @@ def metadata_formatted(metadata): def base_patch_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}) - return metadata \ No newline at end of file + return metadata diff --git a/test/unit_tests/compositor_test.py b/test/unit_tests/compositor_test.py index cca34fc..1d59a2e 100644 --- a/test/unit_tests/compositor_test.py +++ b/test/unit_tests/compositor_test.py @@ -4,6 +4,7 @@ from image_prediction.compositor.compositor import TransformerCompositor from image_prediction.formatter.formatters.camel_case import Snake2CamelCaseKeyFormatter from image_prediction.formatter.formatters.enum import EnumFormatter from image_prediction.formatter.formatters.identity import IdentityFormatter +from image_prediction.info import Info from test.utils.comparison import transform_equal @@ -18,12 +19,12 @@ def test_composition(metadata, metadata_formatted): @pytest.fixture() -def compositor_test_enum_metadata(info_label_map): - return [{info_label_map.WIDTH: 100, info_label_map.PAGE_WIDTH: 200}] +def compositor_test_enum_metadata(): + return [{Info.WIDTH: 100, Info.PAGE_WIDTH: 200}] @pytest.fixture() -def compositor_test_camel_case_metadata(info_label_map): +def compositor_test_camel_case_metadata(): return [{"width": 100, "pageWidth": 200}]