@@ -72,22 +72,3 @@ async def test_method_initialization():
7272)
7373def test_tool_allows_valid_names (name : str ) -> None :
7474 Tool (name = name , inputSchema = {"type" : "object" })
75-
76-
77- @pytest .mark .parametrize (
78- ("name" , "expected" ),
79- [
80- ("" , "Invalid tool name length: 0. Tool name must be between 1 and 128 characters." ),
81- ("x" * 129 , "Invalid tool name length: 129. Tool name must be between 1 and 128 characters." ),
82- ("has space" , "Invalid tool name characters. Allowed: A-Z, a-z, 0-9, underscore (_), dash (-), dot (.)." ),
83- ("comma,name" , "Invalid tool name characters. Allowed: A-Z, a-z, 0-9, underscore (_), dash (-), dot (.)." ),
84- ("not/allowed" , "Invalid tool name characters. Allowed: A-Z, a-z, 0-9, underscore (_), dash (-), dot (.)." ),
85- ("name@" , "Invalid tool name characters. Allowed: A-Z, a-z, 0-9, underscore (_), dash (-), dot (.)." ),
86- ("name#" , "Invalid tool name characters. Allowed: A-Z, a-z, 0-9, underscore (_), dash (-), dot (.)." ),
87- ("name$" , "Invalid tool name characters. Allowed: A-Z, a-z, 0-9, underscore (_), dash (-), dot (.)." ),
88- ],
89- )
90- def test_tool_rejects_invalid_names (name : str , expected : str ) -> None :
91- with pytest .raises (ValueError ) as exc_info :
92- Tool (name = name , inputSchema = {"type" : "object" })
93- assert expected in str (exc_info .value )
0 commit comments