1

Ajoute le graphique du nombre de minifigs par set

This commit is contained in:
2025-12-02 00:31:22 +01:00
parent af51711535
commit c4a6fb871a
7 changed files with 219 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
"""Tests du graphique des minifigs par set."""
import matplotlib
from pathlib import Path
from lib.plots.minifig_counts import plot_minifigs_per_set
matplotlib.use("Agg")
def test_plot_minifigs_per_set_outputs_image(tmp_path: Path) -> None:
"""Génère l'image du nombre de minifigs par set."""
counts_path = tmp_path / "minifig_counts_by_set.csv"
destination_path = tmp_path / "figures" / "step20" / "minifigs_per_set.png"
counts_path.write_text(
"set_num,set_id,name,year,minifig_count\n"
"123-1,123,Set A,2020,2\n"
"124-1,124,Set B,2021,1\n"
)
plot_minifigs_per_set(counts_path, destination_path)
assert destination_path.exists()
assert destination_path.stat().st_size > 0