Skip to content

Commit

Permalink
fix: add a few unit tests
Browse files Browse the repository at this point in the history
Signed-off-by: Sylvain Leclerc <[email protected]>
  • Loading branch information
sylvlecl committed Oct 10, 2024
1 parent e5e2099 commit 3445ea3
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
3 changes: 0 additions & 3 deletions tests/unit/test_data_repo_tinydb.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
23 changes: 23 additions & 0 deletions tests/unit/test_study_dto.py
Original file line number Diff line number Diff line change
@@ -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")

0 comments on commit 3445ea3

Please sign in to comment.