File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -40,10 +40,29 @@ async def test_list_tools():
40
40
(tool for tool in tools if tool .name == "edit_text_file_contents" ), None
41
41
)
42
42
assert edit_contents_tool is not None
43
- assert "edit " in edit_contents_tool .description .lower ()
43
+ assert "file " in edit_contents_tool .description .lower ()
44
44
assert "contents" in edit_contents_tool .description .lower ()
45
45
46
46
47
+ @pytest .mark .asyncio
48
+ async def test_get_contents_empty_files ():
49
+ """Test get_contents handler with empty files list."""
50
+ arguments = {"files" : []}
51
+ result = await get_contents_handler .run_tool (arguments )
52
+ assert len (result ) == 1
53
+ assert result [0 ].type == "text"
54
+ # Should return empty JSON object
55
+ assert json .loads (result [0 ].text ) == {}
56
+
57
+
58
+ @pytest .mark .asyncio
59
+ async def test_unknown_tool_handler ():
60
+ """Test handling of unknown tool name."""
61
+ with pytest .raises (ValueError ) as excinfo :
62
+ await call_tool ("unknown_tool" , {})
63
+ assert "Unknown tool: unknown_tool" in str (excinfo .value )
64
+
65
+
47
66
@pytest .mark .asyncio
48
67
async def test_edit_contents_empty_patches ():
49
68
"""Test editing file contents with empty patches list."""
You can’t perform that action at this time.
0 commit comments