"""Tests for AI model tier configuration."""
from app.core.config import settings


def test_ai_model_tiers_exist():
    assert "fast" in settings.AI_MODEL_TIERS
    assert "standard" in settings.AI_MODEL_TIERS


def test_action_model_map_covers_all_actions():
    valid_tiers = set(settings.AI_MODEL_TIERS.keys())
    for action, tier in settings.ACTION_MODEL_MAP.items():
        assert tier in valid_tiers, f"Action '{action}' maps to unknown tier '{tier}'"


def test_get_model_for_action():
    model = settings.get_model_for_action("generate_full")
    assert isinstance(model, str)
    assert len(model) > 0


def test_get_model_for_action_unknown_falls_back():
    model = settings.get_model_for_action("nonexistent_action")
    assert model == settings.AI_MODEL_TIERS["standard"]
