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 thématiques par FakeDataInclusionClient.search_…
Browse files Browse the repository at this point in the history
…services()
  • Loading branch information
ggounot committed Oct 2, 2024
1 parent 0b2845e commit 7b4f361
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions dora/data_inclusion/tests.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from .constants import THEMATIQUES_MAPPING_DI_TO_DORA
from .constants import THEMATIQUES_MAPPING_DI_TO_DORA, THEMATIQUES_MAPPING_DORA_TO_DI
from .mappings import map_service
from .test_utils import make_di_service_data
from .test_utils import FakeDataInclusionClient, make_di_service_data


def test_map_service_thematiques_mapping():
Expand All @@ -21,3 +21,16 @@ def test_map_service_thematiques_mapping():

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


def test_di_client_search_thematiques_mapping():
input_thematique = list(THEMATIQUES_MAPPING_DORA_TO_DI.keys())[0]
output_thematique = list(THEMATIQUES_MAPPING_DORA_TO_DI.values())[0][0]

di_client = FakeDataInclusionClient()
di_service_data = make_di_service_data(thematiques=[output_thematique])
di_client.services.append(di_service_data)

results = di_client.search_services(thematiques=[input_thematique])

assert len(results) == 1

0 comments on commit 7b4f361

Please sign in to comment.