from pathlib import Path

import pytest  # type:ignore[import]
from helpers import create_maus_and_assert, write_to_file_or_assert_equality  # type:ignore[import]


class TestStammdatenaenderungMaus:
    """
    A unit test that ensures that the 111xx MAUS.json are created.
    """

    @pytest.mark.datafiles("./edifact-templates/edi/UTILMD/UTILMD5.2e.template")
    @pytest.mark.datafiles("../../machine-readable_anwendungshandbuecher/FV2210/UTILMD/flatahb/11109.json")
    @pytest.mark.datafiles("../unit_tests/migs/FV2210/segment_group_hierarchies/sgh_utilmd.json")
    def test_maus_creation_11109_52e(self, datafiles):
        create_maus_and_assert(
            flat_ahb_path=Path(datafiles) / "11109.json",
            sgh_path=Path(datafiles) / "sgh_utilmd.json",
            template_path=Path(datafiles) / Path("UTILMD5.2e.template"),
            maus_path=Path("edifact-templates/maus/FV2210/UTILMD/11109_maus.json"),
        )

    @pytest.mark.datafiles("./edifact-templates/edi/UTILMD/UTILMD5.2e.template")
    @pytest.mark.datafiles("../../machine-readable_anwendungshandbuecher/FV2210/UTILMD/flatahb/11115.json")
    @pytest.mark.datafiles("../unit_tests/migs/FV2210/segment_group_hierarchies/sgh_utilmd.json")
    def test_maus_creation_11115_52e(self, datafiles):
        create_maus_and_assert(
            flat_ahb_path=Path(datafiles) / "11115.json",
            sgh_path=Path(datafiles) / "sgh_utilmd.json",
            template_path=Path(datafiles) / Path("UTILMD5.2e.template"),
            maus_path=Path("edifact-templates/maus/FV2210/UTILMD/11115_maus.json"),
        )

    @pytest.mark.datafiles("./edifact-templates/edi/UTILMD/UTILMD5.2e.template")
    @pytest.mark.datafiles("../../machine-readable_anwendungshandbuecher/FV2210/UTILMD/flatahb/11116.json")
    @pytest.mark.datafiles("../unit_tests/migs/FV2210/segment_group_hierarchies/sgh_utilmd.json")
    def test_maus_creation_11116_52e(self, datafiles):
        create_maus_and_assert(
            flat_ahb_path=Path(datafiles) / "11116.json",
            sgh_path=Path(datafiles) / "sgh_utilmd.json",
            template_path=Path(datafiles) / Path("UTILMD5.2e.template"),
            maus_path=Path("edifact-templates/maus/FV2210/UTILMD/11116_maus.json"),
        )

    # @pytest.mark.datafiles("./edifact-templates/edi/UTILMD/UTILMD5.2e.template")
    # @pytest.mark.datafiles("../../machine-readable_anwendungshandbuecher/FV2210/UTILMD/flatahb/11120.json")
    # @pytest.mark.datafiles("../unit_tests/migs/FV2210/segment_group_hierarchies/sgh_utilmd.json")
    # def test_maus_creation_11120_52e(self, datafiles):
    #    create_maus_and_assert(
    #        flat_ahb_path=Path(datafiles) / "11120.json",
    #         sgh_path=Path(datafiles) / "sgh_utilmd.json",
    #        template_path=Path(datafiles) / Path("UTILMD5.2e.template"),
    #         maus_path=Path("edifact-templates/maus/FV2210/UTILMD/11120_maus.json"),
    #     )

    # @pytest.mark.datafiles("./edifact-templates/edi/UTILMD/UTILMD5.2e.template")
    # @pytest.mark.datafiles("../../machine-readable_anwendungshandbuecher/FV2210/UTILMD/flatahb/11124.json")
    # @pytest.mark.datafiles("../unit_tests/migs/FV2210/segment_group_hierarchies/sgh_utilmd.json")
    # def test_maus_creation_11124_52e(self, datafiles):
    #     create_maus_and_assert(
    #         flat_ahb_path=Path(datafiles) / "11124.json",
    #         sgh_path=Path(datafiles) / "sgh_utilmd.json",
    #         template_path=Path(datafiles) / Path("UTILMD5.2e.template"),
    #         maus_path=Path("edifact-templates/maus/FV2210/UTILMD/11124_maus.json"),
    #     )
    #
    # @pytest.mark.datafiles("./edifact-templates/edi/UTILMD/UTILMD5.2e.template")
    # @pytest.mark.datafiles("../../machine-readable_anwendungshandbuecher/FV2210/UTILMD/flatahb/11127.json")
    # @pytest.mark.datafiles("../unit_tests/migs/FV2210/segment_group_hierarchies/sgh_utilmd.json")
    # def test_maus_creation_11127_52e(self, datafiles):
    #     create_maus_and_assert(
    #         flat_ahb_path=Path(datafiles) / "11127.json",
    #         sgh_path=Path(datafiles) / "sgh_utilmd.json",
    #         template_path=Path(datafiles) / Path("UTILMD5.2e.template"),
    #         maus_path=Path("edifact-templates/maus/FV2210/UTILMD/11127_maus.json"),
    #     )

    """
    @pytest.mark.datafiles("./edifact-templates/edi/UTILMD/UTILMD5.2c.template")
    @pytest.mark.datafiles("./edifact-templates/ahbs/FV2110/UTILMD/11117.csv")
    @pytest.mark.datafiles("../unit_tests/migs/FV2204/segment_group_hierarchies/sgh_utilmd.json")
    def test_maus_creation_11117(self, datafiles):
        create_maus_and_assert(
            flat_ahb_path=Path(datafiles) / "11117.json",
            sgh_path=Path(datafiles) / "sgh_utilmd.json",
            template_path=Path(datafiles) / Path("UTILMD5.2c.template"),
            maus_path=Path("edifact-templates/maus/FV2110/UTILMD/11117_maus.json"),
        )

    @pytest.mark.datafiles("./edifact-templates/edi/UTILMD/UTILMD5.2c.template")
    @pytest.mark.datafiles("./edifact-templates/ahbs/FV2110/UTILMD/11119.csv")
    @pytest.mark.datafiles("../unit_tests/migs/FV2204/segment_group_hierarchies/sgh_utilmd.json")
    def test_maus_creation_11119(self, datafiles):
        create_maus_and_assert(
            flat_ahb_path=Path(datafiles) / "11119.json",
            sgh_path=Path(datafiles) / "sgh_utilmd.json",
            template_path=Path(datafiles) / Path("UTILMD5.2c.template"),
            maus_path=Path("edifact-templates/maus/FV2110/UTILMD/11119_maus.json"),
        )
    """

    @pytest.mark.datafiles("./edifact-templates/edi/UTILMD/UTILMD5.2e.template")
    @pytest.mark.datafiles("../../machine-readable_anwendungshandbuecher/FV2210/UTILMD/flatahb/11161.json")
    @pytest.mark.datafiles("../unit_tests/migs/FV2210/segment_group_hierarchies/sgh_utilmd.json")
    def test_maus_creation_11161_52e(self, datafiles):
        create_maus_and_assert(
            flat_ahb_path=Path(datafiles) / "11161.json",
            sgh_path=Path(datafiles) / "sgh_utilmd.json",
            template_path=Path(datafiles) / Path("UTILMD5.2e.template"),
            maus_path=Path("edifact-templates/maus/FV2210/UTILMD/11161_maus.json"),
        )

    # 11170 seems to be gone in FV2210

    @pytest.mark.datafiles("./edifact-templates/edi/UTILMD/UTILMD5.2e.template")
    @pytest.mark.datafiles("../../machine-readable_anwendungshandbuecher/FV2210/UTILMD/flatahb/11186.json")
    @pytest.mark.datafiles("../unit_tests/migs/FV2210/segment_group_hierarchies/sgh_utilmd.json")
    def test_maus_creation_11186_52e(self, datafiles):
        create_maus_and_assert(
            flat_ahb_path=Path(datafiles) / "11186.json",
            sgh_path=Path(datafiles) / "sgh_utilmd.json",
            template_path=Path(datafiles) / Path("UTILMD5.2e.template"),
            maus_path=Path("edifact-templates/maus/FV2210/UTILMD/11186_maus.json"),
        )

    # @pytest.mark.datafiles("./edifact-templates/edi/UTILMD/UTILMD5.2e.template")
    # @pytest.mark.datafiles("../../machine-readable_anwendungshandbuecher/FV2210/UTILMD/flatahb/11123.json")
    # @pytest.mark.datafiles("../unit_tests/migs/FV2210/segment_group_hierarchies/sgh_utilmd.json")
    # def test_maus_creation_11123_52e(self, datafiles):
    #     create_maus_and_assert(
    #         flat_ahb_path=Path(datafiles) / "11123.json",
    #         sgh_path=Path(datafiles) / "sgh_utilmd.json",
    #         template_path=Path(datafiles) / Path("UTILMD5.2e.template"),
    #         maus_path=Path("edifact-templates/maus/FV2210/UTILMD/11123_maus.json"),
    #     )
    #
    # @pytest.mark.datafiles("./edifact-templates/edi/UTILMD/UTILMD5.2e.template")
    # @pytest.mark.datafiles("../../machine-readable_anwendungshandbuecher/FV2210/UTILMD/flatahb/11218.json")
    # @pytest.mark.datafiles("../unit_tests/migs/FV2210/segment_group_hierarchies/sgh_utilmd.json")
    # def test_maus_creation_11218_52e(self, datafiles):
    #     create_maus_and_assert(
    #         flat_ahb_path=Path(datafiles) / "11218.json",
    #         sgh_path=Path(datafiles) / "sgh_utilmd.json",
    #         template_path=Path(datafiles) / Path("UTILMD5.2e.template"),
    #         maus_path=Path("edifact-templates/maus/FV2210/UTILMD/11218_maus.json"),
    #     )
    #
    # @pytest.mark.datafiles("./edifact-templates/edi/UTILMD/UTILMD5.2e.template")
    # @pytest.mark.datafiles("../../machine-readable_anwendungshandbuecher/FV2210/UTILMD/flatahb/11219.json")
    # @pytest.mark.datafiles("../unit_tests/migs/FV2210/segment_group_hierarchies/sgh_utilmd.json")
    # def test_maus_creation_11219_52e(self, datafiles):
    #     create_maus_and_assert(
    #         flat_ahb_path=Path(datafiles) / "11219.json",
    #         sgh_path=Path(datafiles) / "sgh_utilmd.json",
    #         template_path=Path(datafiles) / Path("UTILMD5.2e.template"),
    #         maus_path=Path("edifact-templates/maus/FV2210/UTILMD/11219_maus.json"),
    #     )

    # 11194 seems to be gone in FV2210
