You've already forked etude_lego_jurassic_world
Ajoute le graphique variations vs total par personnage
This commit is contained in:
@@ -4,6 +4,7 @@ import matplotlib
|
||||
from pathlib import Path
|
||||
|
||||
from lib.plots.minifig_characters import plot_minifigs_per_character
|
||||
from lib.plots.minifig_characters import plot_character_variations_vs_total
|
||||
|
||||
|
||||
matplotlib.use("Agg")
|
||||
@@ -23,3 +24,19 @@ def test_plot_minifigs_per_character(tmp_path: Path) -> None:
|
||||
|
||||
assert destination.exists()
|
||||
assert destination.stat().st_size > 0
|
||||
|
||||
|
||||
def test_plot_character_variations_vs_total(tmp_path: Path) -> None:
|
||||
"""Génère l'image comparant total et variations par personnage."""
|
||||
counts_path = tmp_path / "variations.csv"
|
||||
destination = tmp_path / "figures" / "step22" / "minifig_character_variations_totals.png"
|
||||
counts_path.write_text(
|
||||
"known_character,gender,variation_count,total_minifigs\n"
|
||||
"Owen Grady,male,2,3\n"
|
||||
"Ellie Sattler,female,1,2\n"
|
||||
)
|
||||
|
||||
plot_character_variations_vs_total(counts_path, destination)
|
||||
|
||||
assert destination.exists()
|
||||
assert destination.stat().st_size > 0
|
||||
|
||||
Reference in New Issue
Block a user