Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(api): add missing denormalized rules in refactor export_study_fla… #1676

Closed
wants to merge 13 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(api): fix failed tests (#1646)
TLAIDI authored and laurent-laporte-pro committed Sep 12, 2023
commit 71cfa5267436b0bdfae42e802b91a6dd74e6a78e
1 change: 1 addition & 0 deletions tests/storage/integration/test_exporter.py
Original file line number Diff line number Diff line change
@@ -118,6 +118,7 @@ def test_export_flat(
export_study_flat(
path_studies / "STA-mini",
export_path / "STA-mini-export",
Mock(),
outputs,
output_list,
)
10 changes: 9 additions & 1 deletion tests/variantstudy/model/test_variant_model.py
Original file line number Diff line number Diff line change
@@ -13,6 +13,7 @@
from antarest.core.utils.fastapi_sqlalchemy import DBSessionMiddleware, db
from antarest.study.model import DEFAULT_WORKSPACE_NAME, RawStudy, 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
from antarest.study.storage.variantstudy.repository import VariantStudyRepository
from antarest.study.storage.variantstudy.variant_study_service import SNAPSHOT_RELATIVE_PATH, VariantStudyService
@@ -28,7 +29,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,
@@ -41,6 +47,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(),
@@ -176,6 +183,7 @@ def test_smart_generation(mock_export, tmp_path: Path, command_factory: CommandF
def export_flat(
path_study: Path,
dest: Path,
study_factory: VariantStudy,
outputs: bool = True,
denormalize: bool = True,
) -> None: