-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathmcp_integration_http_test.go
More file actions
41 lines (34 loc) · 1.17 KB
/
Copy pathmcp_integration_http_test.go
File metadata and controls
41 lines (34 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package remindb_test
import (
"strings"
"testing"
"github.com/radimsem/remindb/internal/mcptest"
)
func TestMcp_HttpTransport(t *testing.T) {
env := mcptest.NewHttpEnv(t)
fixture := env.StageFixture(t, "testdata/sample.md")
compileResult := env.CallTool(t, "MemoryCompile", map[string]any{
"path": fixture,
"message": "http-init",
})
if text := env.TextContent(t, compileResult); !strings.Contains(text, "compiled") {
t.Fatalf("unexpected compile result: %s", text)
}
treeResult := env.CallTool(t, "MemoryTree", map[string]any{})
if text := env.TextContent(t, treeResult); !strings.Contains(text, "Top Heading") {
t.Errorf("tree missing expected heading; got: %s", text)
}
searchResult := env.CallTool(t, "MemorySearch", map[string]any{
"query": "paragraph",
"budget": 1000,
})
if text := env.TextContent(t, searchResult); text == "no results" {
t.Fatal("expected search results for 'paragraph' in sample.md")
}
writeResult := env.CallTool(t, "MemoryWrite", map[string]any{
"payload": "HTTP transport smoke test write",
})
if text := env.TextContent(t, writeResult); !strings.Contains(text, "wrote") {
t.Errorf("unexpected write result: %s", text)
}
}