Reject null agent registry fields
This commit is contained in:
parent
e801225220
commit
2fb6c10a5a
2 changed files with 31 additions and 4 deletions
|
|
@ -117,3 +117,22 @@ def test_load_agent_registry_rejects_malformed_yaml(tmp_path: Path):
|
|||
|
||||
with pytest.raises(AgentRegistryError, match="invalid agent registry YAML"):
|
||||
load_agent_registry(path)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"content",
|
||||
[
|
||||
"agents:\n"
|
||||
" - id: null\n"
|
||||
" label: Analyst\n",
|
||||
"agents:\n"
|
||||
" - id: agent-1\n"
|
||||
" label: null\n",
|
||||
],
|
||||
)
|
||||
def test_load_agent_registry_rejects_null_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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue