Spaces:
Running
Running
Download tests/test_security.py from Leon4gr45/needle: direct link, hf CLI and curl.
- Browser
- Download file 511 Bytes
-
https://huggingface.co/spaces/Leon4gr45/needle/resolve/main/tests/test_security.py
- Command line
-
hf download hf://spaces/Leon4gr45/needle/tests/test_security.py
-
curl -L -o test_security.py https://huggingface.co/spaces/Leon4gr45/needle/resolve/main/tests/test_security.py
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) | |