Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Commit

Permalink
Ajout test mapping de thematiques par map_service()
Browse files Browse the repository at this point in the history
  • Loading branch information
ggounot committed Oct 2, 2024
1 parent e488f70 commit dd02bb3
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions dora/data_inclusion/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from .constants import THEMATIQUES_MAPPING_DI_TO_DORA
from .mappings import map_service
from .test_utils import make_di_service_data


def test_map_service_thematiques_mapping():
input_thematiques = [
"logement-hebergement",
"logement-hebergement--connaissance-de-ses-droits-et-interlocuteurs",
"logement-hebergement--besoin-dadapter-mon-logement",
] + list(THEMATIQUES_MAPPING_DI_TO_DORA.keys())

expected_categories = ["logement-hebergement"]
expected_subcategories = [
"logement-hebergement--connaissance-de-ses-droits-et-interlocuteurs",
"logement-hebergement--besoin-dadapter-mon-logement",
] + list(THEMATIQUES_MAPPING_DI_TO_DORA.values())

di_service_data = make_di_service_data(thematiques=input_thematiques)
service = map_service(di_service_data, False)

assert set(service["categories"]) == set(expected_categories)
assert set(service["subcategories"]) == set(expected_subcategories)

0 comments on commit dd02bb3

Please sign in to comment.