MCPcopy Create free account
hub / github.com/MiniMax-AI/Mini-Agent / test_write_tool

Function test_write_tool

tests/test_tools.py:36–49  ·  view source on GitHub ↗

Test write file tool.

()

Source from the content-addressed store, hash-verified

34
35@pytest.mark.asyncio
36async def test_write_tool():
37 """Test write file tool."""
38 print("\n=== Testing WriteTool ===")
39
40 with tempfile.TemporaryDirectory() as tmpdir:
41 file_path = Path(tmpdir) / "test.txt"
42
43 tool = WriteTool()
44 result = await tool.execute(path=str(file_path), content="Test content")
45
46 assert result.success, f"Write failed: {result.error}"
47 assert file_path.exists(), "File was not created"
48 assert file_path.read_text() == "Test content", "Content mismatch"
49 print("✅ WriteTool test passed")
50
51
52@pytest.mark.asyncio

Callers 1

mainFunction · 0.85

Calls 2

executeMethod · 0.95
WriteToolClass · 0.90

Tested by

no test coverage detected