1

Exclusion des pièces imprimées dans la recherche de rareté

This commit is contained in:
2025-12-03 17:21:00 +01:00
parent 3f81f0bbde
commit a474e57694
4 changed files with 40 additions and 1 deletions

View File

@@ -58,6 +58,7 @@ def test_build_part_rarity_counts_spares_and_ignores_categories(tmp_path: Path)
["p4", "Figure Limb", "41", "Plastic"],
["p5", "Sticker Sheet", "58", "Plastic"],
["p6", "Exclusive Tile", "1", "Plastic"],
["p7", "Slope 45 print", "1", "Plastic"],
],
)
part_categories = tmp_path / "part_categories.csv"
@@ -95,6 +96,7 @@ def test_build_part_rarity_counts_spares_and_ignores_categories(tmp_path: Path)
["3", "p4", "1", "4", "True", ""],
["4", "p1", "1", "8", "False", ""],
["5", "p5", "1", "9", "False", ""],
["5", "p7", "1", "5", "False", ""],
],
)
@@ -150,6 +152,17 @@ def test_build_part_rarity_counts_spares_and_ignores_categories(tmp_path: Path)
]
assert select_until_reused(rows) == [rows[0], rows[1]]
rows_no_print = build_part_rarity(
parts_filtered,
inventories,
inventory_parts,
parts_catalog,
part_categories,
sets_enriched,
exclude_printed=True,
)
assert all(r["part_num"] != "p7" for r in rows_no_print)
def test_write_part_rarity_outputs_csv(tmp_path: Path) -> None:
"""Sérialise le classement de rareté."""