Skip to content

Commit

Permalink
fix(api): fix failed tests (#1646)
Browse files Browse the repository at this point in the history
  • Loading branch information
TLAIDI committed Jul 28, 2023
1 parent f2afc37 commit 7dc032b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions tests/storage/integration/test_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ def test_export_flat(
export_study_flat(
path_studies / "STA-mini",
export_path / "STA-mini-export",
Mock(),
outputs,
output_list,
)
Expand Down
10 changes: 9 additions & 1 deletion tests/variantstudy/model/test_variant_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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(),
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 7dc032b

Please sign in to comment.