You've already forked etude_lego_jurassic_world
Ajoute le graphique des personnages représentés
This commit is contained in:
25
tests/test_minifig_characters_plot.py
Normal file
25
tests/test_minifig_characters_plot.py
Normal file
@@ -0,0 +1,25 @@
|
||||
"""Tests du graphique minifigs par personnage."""
|
||||
|
||||
import matplotlib
|
||||
from pathlib import Path
|
||||
|
||||
from lib.plots.minifig_characters import plot_minifigs_per_character
|
||||
|
||||
|
||||
matplotlib.use("Agg")
|
||||
|
||||
|
||||
def test_plot_minifigs_per_character(tmp_path: Path) -> None:
|
||||
"""Génère l'image de comptage par personnage."""
|
||||
counts_path = tmp_path / "counts.csv"
|
||||
destination = tmp_path / "figures" / "step22" / "minifig_characters.png"
|
||||
counts_path.write_text(
|
||||
"known_character,minifig_count\n"
|
||||
"Owen Grady,2\n"
|
||||
"Figurant,1\n"
|
||||
)
|
||||
|
||||
plot_minifigs_per_character(counts_path, destination)
|
||||
|
||||
assert destination.exists()
|
||||
assert destination.stat().st_size > 0
|
||||
Reference in New Issue
Block a user