MCPcopy Create free account
hub / github.com/astercloud/aster / TestReadTool_FileNotFound

Function TestReadTool_FileNotFound

pkg/tools/builtin/read_test.go:155–172  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

153}
154
155func TestReadTool_FileNotFound(t *testing.T) {
156 tool, err := NewReadTool(nil)
157 if err != nil {
158 t.Fatalf("Failed to create Read tool: %v", err)
159 }
160
161 input := map[string]any{
162 "file_path": "/nonexistent/path/file.txt",
163 }
164
165 result := ExecuteToolWithRealFS(t, tool, input)
166
167 // 应该返回错误
168 errMsg := AssertToolError(t, result)
169 if !strings.Contains(errMsg, "no such file") {
170 t.Errorf("Expected file not found error, got: %s", errMsg)
171 }
172}
173
174func TestReadTool_OffsetAndLimit(t *testing.T) {
175 t.Skip("Skipping: offset and limit parameters are not implemented in ReadTool")

Callers

nothing calls this directly

Calls 3

NewReadToolFunction · 0.85
ExecuteToolWithRealFSFunction · 0.85
AssertToolErrorFunction · 0.85

Tested by

no test coverage detected