32 lines
1.1 KiB
Python
32 lines
1.1 KiB
Python
|
|
"""Tests Trainer-Pfad-Schutz (preserve_slot_assignments)."""
|
||
|
|
from planning_exercise_path_builder import (
|
||
|
|
EvaluateStepPayload,
|
||
|
|
ProgressionPathSuggestRequest,
|
||
|
|
_assignment_preservation_active,
|
||
|
|
)
|
||
|
|
|
||
|
|
|
||
|
|
def test_assignment_preservation_explicit_flag():
|
||
|
|
body = ProgressionPathSuggestRequest(
|
||
|
|
query="Kumite Beinarbeit Progression",
|
||
|
|
preserve_slot_assignments=True,
|
||
|
|
)
|
||
|
|
assert _assignment_preservation_active(body)
|
||
|
|
|
||
|
|
|
||
|
|
def test_assignment_preservation_not_auto_from_slot_assignments():
|
||
|
|
"""Nur explizites preserve_slot_assignments — sonst wäre compare/match blockiert."""
|
||
|
|
body = ProgressionPathSuggestRequest(
|
||
|
|
query="Kumite Beinarbeit Progression",
|
||
|
|
slot_assignments=[
|
||
|
|
EvaluateStepPayload(exercise_id=10, roadmap_major_step_index=0),
|
||
|
|
EvaluateStepPayload(exercise_id=11, roadmap_major_step_index=1),
|
||
|
|
],
|
||
|
|
)
|
||
|
|
assert not _assignment_preservation_active(body)
|
||
|
|
|
||
|
|
|
||
|
|
def test_assignment_preservation_inactive_without_assignments():
|
||
|
|
body = ProgressionPathSuggestRequest(query="Kumite Beinarbeit Progression")
|
||
|
|
assert not _assignment_preservation_active(body)
|