MCPcopy Create free account
hub / github.com/codehamr/codehamr / TestReadFileSchemaShape

Function TestReadFileSchemaShape

internal/tools/read_test.go:59–83  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

57}
58
59func TestReadFileSchemaShape(t *testing.T) {
60 sch := ReadFileSchema()
61 fn, ok := sch["function"].(map[string]any)
62 if !ok {
63 t.Fatal("missing function")
64 }
65 if fn["name"] != "read_file" {
66 t.Fatalf("name wrong: %v", fn["name"])
67 }
68 params, ok := fn["parameters"].(map[string]any)
69 if !ok {
70 t.Fatal("missing parameters")
71 }
72 props, ok := params["properties"].(map[string]any)
73 if !ok {
74 t.Fatal("missing properties")
75 }
76 if _, ok := props["path"]; !ok {
77 t.Fatal("missing property \"path\"")
78 }
79 req, ok := params["required"].([]string)
80 if !ok || len(req) != 1 || req[0] != "path" {
81 t.Fatalf("required should be [\"path\"], got %v", params["required"])
82 }
83}
84
85func TestExecuteReadFileWrapsResult(t *testing.T) {
86 dir := t.TempDir()

Callers

nothing calls this directly

Calls 1

ReadFileSchemaFunction · 0.85

Tested by

no test coverage detected