Files
planer/backend/tests/test_config_rollen.py
2026-07-22 16:12:23 +02:00

32 lines
1.0 KiB
Python

"""Rollen-Auflösung: explizit konfiguriert oder harter Stopp — nie ein Default."""
import pytest
import config
def test_konfigurierte_rolle(monkeypatch):
monkeypatch.setenv("ROLLE_SCHNEIDEN", "minimax:minimax/MiniMax-M3")
assert config.resolve_role("schneiden") == ("minimax", "minimax/MiniMax-M3")
def test_unkonfigurierte_rolle_stoppt(monkeypatch):
monkeypatch.delenv("ROLLE_JUDGE", raising=False)
with pytest.raises(RuntimeError, match="kein Modell konfiguriert"):
config.resolve_role("judge")
def test_unbekannter_provider_stoppt(monkeypatch):
monkeypatch.setenv("ROLLE_SICHTEN", "openai:gpt-4")
with pytest.raises(RuntimeError, match="unbekannter Provider"):
config.resolve_role("sichten")
def test_fehlendes_modell_stoppt(monkeypatch):
monkeypatch.setenv("ROLLE_NACHFASS", "minimax")
with pytest.raises(RuntimeError, match="Modell fehlt"):
config.resolve_role("nachfass")
def test_alle_rollen_deklariert():
assert set(config.ROLLEN) == {"schneiden", "nachfass", "sichten", "judge"}