From 7dc032b02a16dd6d64f44a3b6192fd9205b6be37 Mon Sep 17 00:00:00 2001 From: TLAIDI Date: Fri, 28 Jul 2023 15:13:42 +0200 Subject: [PATCH] fix(api): fix failed tests (#1646) --- tests/storage/integration/test_exporter.py | 1 + tests/variantstudy/model/test_variant_model.py | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/storage/integration/test_exporter.py b/tests/storage/integration/test_exporter.py index 9a83fd212c..7f4d0e4812 100644 --- a/tests/storage/integration/test_exporter.py +++ b/tests/storage/integration/test_exporter.py @@ -121,6 +121,7 @@ def test_export_flat( export_study_flat( path_studies / "STA-mini", export_path / "STA-mini-export", + Mock(), outputs, output_list, ) diff --git a/tests/variantstudy/model/test_variant_model.py b/tests/variantstudy/model/test_variant_model.py index 801a86a497..b11a2340e0 100644 --- a/tests/variantstudy/model/test_variant_model.py +++ b/tests/variantstudy/model/test_variant_model.py @@ -15,6 +15,7 @@ StudyAdditionalData, ) from antarest.study.storage.variantstudy.command_factory import CommandFactory +from antarest.study.storage.variantstudy.model.dbmodel import VariantStudy from antarest.study.storage.variantstudy.model.model import ( CommandDTO, GenerationResultInfoDTO, @@ -39,7 +40,12 @@ ) -def test_commands_service(tmp_path: Path, command_factory: CommandFactory): +@patch( + "antarest.study.storage.variantstudy.variant_study_service.export_study_flat" +) +def test_commands_service( + mock_export, tmp_path: Path, command_factory: CommandFactory +): engine = create_engine( "sqlite:///:memory:", echo=False, @@ -52,6 +58,7 @@ def test_commands_service(tmp_path: Path, command_factory: CommandFactory): custom_engine=engine, session_args={"autocommit": False, "autoflush": False}, ) + repository = VariantStudyRepository(LocalCache()) service = VariantStudyService( raw_study_service=Mock(), @@ -214,6 +221,7 @@ def test_smart_generation( def export_flat( path_study: Path, dest: Path, + study_factory: VariantStudy, outputs: bool = True, denormalize: bool = True, ) -> None: