MCPcopy Index your code
hub / github.com/docker/docker-agent / TestMCP_SingleAgent

Function TestMCP_SingleAgent

e2e/mcp_test.go:15–36  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

13)
14
15func TestMCP_SingleAgent(t *testing.T) {
16 t.Parallel()
17
18 ctx := t.Context()
19 agentSource, err := config.Resolve("testdata/basic.yaml", nil)
20 require.NoError(t, err)
21
22 _, runConfig := startRecordingAIProxy(t)
23 team, err := teamloader.Load(ctx, agentSource, runConfig, loaderdefaults.Opts()...)
24 require.NoError(t, err, "Failed to load agent")
25 t.Cleanup(func() {
26 require.NoError(t, team.StopToolSets(ctx))
27 })
28
29 handler := mcp.CreateToolHandler(team, "root")
30 _, output, err := handler(ctx, nil, mcp.ToolInput{
31 Message: "What is 2+2? Answer in one sentence.",
32 })
33
34 require.NoError(t, err)
35 assert.Equal(t, "2 + 2 equals 4.", output.Response)
36}
37
38func TestMCP_MultiAgent(t *testing.T) {
39 t.Parallel()

Callers

nothing calls this directly

Calls 7

ResolveFunction · 0.92
LoadFunction · 0.92
CreateToolHandlerFunction · 0.92
startRecordingAIProxyFunction · 0.85
ContextMethod · 0.80
CleanupMethod · 0.65
StopToolSetsMethod · 0.65

Tested by

no test coverage detected