Files
social-app/backend/tests/unit/schemas/agent/test_system_agent.py
T

32 lines
806 B
Python
Raw Normal View History

from __future__ import annotations
import pytest
from schemas.agent.system_agent import SystemAgentLLMConfig
def test_system_agent_llm_config_normalizes_enabled_tools_aliases() -> None:
config = SystemAgentLLMConfig.model_validate(
{
"enabled_tools": [
"calendar.write",
"calendar_write",
"user.lookup",
]
}
)
assert [tool.value for tool in config.enabled_tools] == [
"calendar.write",
"user.lookup",
]
def test_system_agent_llm_config_rejects_unknown_enabled_tool() -> None:
with pytest.raises(ValueError, match="unknown enabled tool"):
SystemAgentLLMConfig.model_validate(
{
"enabled_tools": ["calendar.remove"],
}
)