diff --git a/tests/meta/report/test_mip_dna_api.py b/tests/meta/report/test_mip_dna_api.py index 9c0fd291f3..63e8e138dc 100644 --- a/tests/meta/report/test_mip_dna_api.py +++ b/tests/meta/report/test_mip_dna_api.py @@ -1,4 +1,5 @@ from cg.constants import REPORT_GENDER +from cg.constants.subject import Sex from tests.store_helpers import StoreHelpers diff --git a/tests/meta/workflow/test_balsamic.py b/tests/meta/workflow/test_balsamic.py index 1823af7656..4d7c3df7ba 100644 --- a/tests/meta/workflow/test_balsamic.py +++ b/tests/meta/workflow/test_balsamic.py @@ -19,15 +19,15 @@ def test_get_verified_sex(): # GIVEN a sample object sample_obj = { - "ACC0000A0": {"sex": "female"}, - "ACC0000A1": {"sex": "female"}, + "ACC0000A0": {"sex": Sex.FEMALE}, + "ACC0000A1": {"sex": Sex.FEMALE}, } # WHEN extracting the sex retrieved_sex: Sex = BalsamicAnalysisAPI.get_verified_sex(sample_obj) # THEN sex must match the expected one - assert retrieved_sex == "female" + assert retrieved_sex == Sex.FEMALE def test_get_verified_sex_error(): @@ -49,8 +49,8 @@ def test_get_verified_sex_unknown(caplog): # GIVEN a sample object with different sexes sample_obj = { - "ACC0000A0": {"sex": "unknown"}, - "ACC0000A1": {"sex": "unknown"}, + "ACC0000A0": {"sex": Sex.UNKNOWN}, + "ACC0000A1": {"sex": Sex.UNKNOWN}, } # WHEN extracting the sex diff --git a/tests/mocks/limsmock.py b/tests/mocks/limsmock.py index 3092ec5348..43e11f0b76 100644 --- a/tests/mocks/limsmock.py +++ b/tests/mocks/limsmock.py @@ -4,7 +4,7 @@ from typing_extensions import Literal from cg.apps.lims import LimsAPI -from cg.constants.subject import PhenotypeStatus +from cg.constants.subject import PhenotypeStatus, Sex class LimsProject(BaseModel): @@ -23,7 +23,7 @@ class LimsSample(BaseModel): id: str name: str = None customer: str = None - sex: Literal["male", "female", "unknown"] = None + sex: Literal[Sex.MALE, Sex.FEMALE, Sex.UNKNOWN] = None father: str = None mother: str = None status: Literal[ diff --git a/tests/models/mip/conftest.py b/tests/models/mip/conftest.py index ceac4dd89a..eb6bb9178c 100644 --- a/tests/models/mip/conftest.py +++ b/tests/models/mip/conftest.py @@ -3,6 +3,7 @@ import pytest from cg.constants.priority import SlurmQos +from cg.constants.subject import Sex from cg.models.mip.mip_metrics_deliverables import MIPMetricsDeliverables @@ -165,7 +166,7 @@ def mip_metrics_deliverables_raw() -> dict: "input": "some_input", "name": "gender", "step": "chanjo_sexcheck", - "value": "male", + "value": Sex.MALE, }, { "id": "an_id",