needle / tests /test_security.py
Leon4gr45's picture
Upload folder using huggingface_hub
f049d1e verified
Raw History Blame Contribute Delete
511 Bytes
import pytest
from registry import normalize_tool
def test_normalization_rejects_extra_fields():
raw = {"name": "test", "description": "desc", "parameters": {"type": "object"}, "extra_field": "bad"}
with pytest.raises(ValueError, match="unexpected fields"):
normalize_tool(raw)
def test_normalization_rejects_empty_name():
raw = {"name": "", "description": "desc", "parameters": {"type": "object"}}
with pytest.raises(ValueError, match="non-empty string"):
normalize_tool(raw)