Require string agent registry fields

This commit is contained in:
Mikhail Putilovskij 2026-04-24 13:11:02 +03:00
parent 25aa5d9313
commit 3b0401fb7c
2 changed files with 27 additions and 2 deletions

View file

@ -172,3 +172,28 @@ def test_load_agent_registry_rejects_blank_id_or_label(tmp_path: Path, content:
with pytest.raises(AgentRegistryError, match="each agent entry requires id and label"):
load_agent_registry(path)
@pytest.mark.parametrize(
"content",
[
"agents:\n"
" - id: 123\n"
" label: Analyst\n",
"agents:\n"
" - id: agent-1\n"
" label: 456\n",
"agents:\n"
" - id: true\n"
" label: Analyst\n",
"agents:\n"
" - id: agent-1\n"
" label: false\n",
],
)
def test_load_agent_registry_rejects_non_string_id_or_label(tmp_path: Path, content: str):
path = tmp_path / "agents.yaml"
path.write_text(content, encoding="utf-8")
with pytest.raises(AgentRegistryError, match="each agent entry requires id and label"):
load_agent_registry(path)