39 lines
1.3 KiB
Python
39 lines
1.3 KiB
Python
|
|
"""Tests Namens-Fallback für Katalog-Prompt-Slots."""
|
||
|
|
from catalog_slot_fallbacks import get_fallback_slots_for_entry, merge_stored_slots_with_fallbacks
|
||
|
|
from catalog_prompt_slots import _resolve_entry_slot_values
|
||
|
|
|
||
|
|
|
||
|
|
def test_karate_fallback_has_path_qa():
|
||
|
|
pack = get_fallback_slots_for_entry("focus_area", "Karate")
|
||
|
|
assert "Kohärente Progression" in pack.get("hints_on_path_qa", "")
|
||
|
|
|
||
|
|
|
||
|
|
def test_db_value_overrides_fallback():
|
||
|
|
merged = merge_stored_slots_with_fallbacks(
|
||
|
|
{"hints_on_path_qa": "Eigener QS-Text."},
|
||
|
|
catalog_kind="focus_area",
|
||
|
|
name="Karate",
|
||
|
|
stammdaten_description="Traditionelles Karate",
|
||
|
|
)
|
||
|
|
assert merged["hints_on_path_qa"] == "Eigener QS-Text."
|
||
|
|
|
||
|
|
|
||
|
|
def test_empty_db_uses_karate_fallback():
|
||
|
|
merged = _resolve_entry_slot_values(
|
||
|
|
{},
|
||
|
|
{"name": "Karate", "description": "Traditionelles Karate"},
|
||
|
|
"focus_area",
|
||
|
|
)
|
||
|
|
assert "Kihon-Progression" in merged["description"] or "Technik-Curriculum" in merged["description"]
|
||
|
|
assert "Kohärente Progression" in merged["hints_on_path_qa"]
|
||
|
|
|
||
|
|
|
||
|
|
def test_gewaltschutz_fallback_no_kumite():
|
||
|
|
merged = _resolve_entry_slot_values(
|
||
|
|
{},
|
||
|
|
{"name": "Gewaltschutz", "description": "Gewaltprävention"},
|
||
|
|
"focus_area",
|
||
|
|
)
|
||
|
|
assert "Deeskalation" in merged["hints_on_path_qa"]
|
||
|
|
assert "Kumite-Tiefe" in merged["anti_patterns"]
|