"""Tests du chargement des jalons configurables."""

from pathlib import Path

from lib.milestones import load_milestones


def test_load_milestones_reads_csv(tmp_path: Path) -> None:
    """Charge le CSV et convertit l'année en entier."""
    source = tmp_path / "milestones.csv"
    source.write_text(
        "year,description\n"
        "1993,Sortie du film Jurassic Park\n"
        "1997,Sortie du film The Lost World: Jurassic Park\n"
    )

    milestones = load_milestones(source)

    assert milestones == [
        {"year": 1993, "description": "Sortie du film Jurassic Park"},
        {"year": 1997, "description": "Sortie du film The Lost World: Jurassic Park"},
    ]
