MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / TestRecord_Claude

Function TestRecord_Claude

internal/observedtools/store_test.go:7–35  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

5)
6
7func TestRecord_Claude(t *testing.T) {
8 s := NewStore()
9 rawJSON := []byte(`{
10 "model": "claude-3-opus",
11 "messages": [{"role": "user", "content": "hi"}],
12 "tools": [
13 {"name": "Bash", "description": "Run bash", "input_schema": {"type": "object", "properties": {"command": {"type": "string"}}}},
14 {"name": "Read", "description": "Read file", "input_schema": {"type": "object", "properties": {"path": {"type": "string"}}}}
15 ]
16 }`)
17
18 s.Record(rawJSON, "claude")
19 tools := s.List()
20
21 if len(tools) != 2 {
22 t.Fatalf("expected 2 tools, got %d", len(tools))
23 }
24
25 // Sorted by name
26 if tools[0].Name != "Bash" || tools[0].Format != "claude" {
27 t.Errorf("unexpected tool[0]: %+v", tools[0])
28 }
29 if tools[1].Name != "Read" || tools[1].Format != "claude" {
30 t.Errorf("unexpected tool[1]: %+v", tools[1])
31 }
32 if tools[0].Schema == nil {
33 t.Error("expected schema for Bash tool")
34 }
35}
36
37func TestRecord_OpenAI(t *testing.T) {
38 s := NewStore()

Callers

nothing calls this directly

Calls 4

RecordMethod · 0.95
ListMethod · 0.95
NewStoreFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected