2026-05-23 12:02:57 +02:00
|
|
|
"""Tests Planungs-KI Phase C3/E — Pfad-Vorschläge."""
|
|
|
|
|
from planning_exercise_path_builder import _pick_best_path_hit, _hit_to_path_step
|
2026-05-23 11:46:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_pick_next_path_hit_skips_used():
|
2026-05-23 12:02:57 +02:00
|
|
|
hits = [{"id": 1, "title": "A", "semantic_score": 0.2}, {"id": 2, "title": "B", "semantic_score": 0.2}, {"id": 3, "title": "C", "semantic_score": 0.2}]
|
|
|
|
|
assert _pick_best_path_hit(hits, {1})["id"] == 2
|
|
|
|
|
assert _pick_best_path_hit(hits, {1, 2, 3}) is None
|
2026-05-23 11:46:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_hit_to_path_step_maps_variant():
|
|
|
|
|
step = _hit_to_path_step(
|
|
|
|
|
{
|
|
|
|
|
"id": 10,
|
|
|
|
|
"title": "Test",
|
|
|
|
|
"score": 0.8,
|
|
|
|
|
"reasons": ["Graph"],
|
|
|
|
|
"suggested_variant_id": 7,
|
|
|
|
|
"suggested_variant_name": "Leicht",
|
|
|
|
|
"variants": [{"id": 7, "variant_name": "Leicht"}],
|
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
assert step["exercise_id"] == 10
|
|
|
|
|
assert step["variant_id"] == 7
|
|
|
|
|
assert step["suggested_variant_name"] == "Leicht"
|