gmao/tests/integration/test_preventive_catalog.py
root 0f6770611f
Some checks are pending
CI - Tests et Syntax / lint-and-test (push) Waiting to run
feat(preventive): embed historical lot task catalogue
2026-08-23 12:08:05 +00:00

16 lines
812 B
Python

from app_new.core.setup_catalog import LOT_TASKS
def test_embedded_preventive_catalog_has_historical_shape():
"""Garde-fou du catalogue extrait du dump de référence."""
assert len(LOT_TASKS) == 330
assert all(item['lot'] and item['tache'] for item in LOT_TASKS)
assert all(item['type_maintenance'] in ('préventive', 'preventive', 'curative', None) for item in LOT_TASKS)
assert sum(item['duree_minutes'] is not None for item in LOT_TASKS) == 5
assert sum(bool(item['periodicite']) for item in LOT_TASKS) == 327
assert len({(item['lot'], item['num_tache']) for item in LOT_TASKS}) == len(LOT_TASKS)
def test_catalog_tasks_have_stable_functional_keys():
keys = [(item['lot'].casefold(), item['tache'].casefold()) for item in LOT_TASKS]
assert len(keys) == len(set(keys))