diff --git a/tests/unit/test_data_repo_tinydb.py b/tests/unit/test_data_repo_tinydb.py index 52ad688..ee46549 100644 --- a/tests/unit/test_data_repo_tinydb.py +++ b/tests/unit/test_data_repo_tinydb.py @@ -1,10 +1,7 @@ import random from pathlib import Path -from unittest import mock -from uuid import uuid4 import pytest -import tinydb from antareslauncher.data_repo.data_repo_tinydb import DataRepoTinydb from antareslauncher.study_dto import StudyDTO diff --git a/tests/unit/test_study_dto.py b/tests/unit/test_study_dto.py new file mode 100644 index 0000000..5f33287 --- /dev/null +++ b/tests/unit/test_study_dto.py @@ -0,0 +1,23 @@ +from antares.study.version import StudyVersion + +from antareslauncher.study_dto import StudyDTO + + +def test_study_dto_from_dict_old_version_syntax(): + + study_dict = { + "path": "/path/to/study", + "antares_version": 880 + } + + study_dto = StudyDTO.from_dict(study_dict) + assert study_dto.antares_version == StudyVersion.parse("8.8") + + +def test_study_dto_from_dict(): + study_dict = { + "path": "/path/to/study", + "antares_version": "9.0" + } + study_dto = StudyDTO.from_dict(study_dict) + assert study_dto.antares_version == StudyVersion.parse("9.0")