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

Function TestRecord_OpenAI

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

Source from the content-addressed store, hash-verified

35}
36
37func TestRecord_OpenAI(t *testing.T) {
38 s := NewStore()
39 rawJSON := []byte(`{
40 "model": "gpt-4",
41 "messages": [],
42 "tools": [
43 {"type": "function", "function": {"name": "ls", "parameters": {"type": "object", "properties": {"path": {"type": "string"}}}}}
44 ]
45 }`)
46
47 s.Record(rawJSON, "openai")
48 tools := s.List()
49
50 if len(tools) != 1 {
51 t.Fatalf("expected 1 tool, got %d", len(tools))
52 }
53 if tools[0].Name != "ls" || tools[0].Format != "openai" {
54 t.Errorf("unexpected tool: %+v", tools[0])
55 }
56}
57
58func TestRecord_NoTools(t *testing.T) {
59 s := NewStore()

Callers

nothing calls this directly

Calls 3

RecordMethod · 0.95
ListMethod · 0.95
NewStoreFunction · 0.85

Tested by

no test coverage detected