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)