init
This commit is contained in:
31
backend/tests/test_config_rollen.py
Normal file
31
backend/tests/test_config_rollen.py
Normal file
@@ -0,0 +1,31 @@
|
||||
"""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"}
|
||||
Reference in New Issue
Block a user