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

Function TestToolsetInstructions

pkg/teamloader/teamloader_test.go:396–414  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

394}
395
396func TestToolsetInstructions(t *testing.T) {
397 t.Setenv("OPENAI_API_KEY", "dummy")
398
399 agentSource, err := config.Resolve("testdata/tool-instruction.yaml", nil)
400 require.NoError(t, err)
401
402 team, err := Load(t.Context(), agentSource, &config.RuntimeConfig{}, withTestProviderRegistry()...)
403 require.NoError(t, err)
404
405 agent, err := team.Agent("root")
406 require.NoError(t, err)
407
408 toolsets := agent.ToolSets()
409 require.Len(t, toolsets, 1)
410
411 instructions := tools.GetInstructions(toolsets[0])
412 expected := "Dummy fetch tool instruction"
413 require.Equal(t, expected, instructions)
414}
415
416// TestInstructionExpansion verifies that ${env.X} placeholders are expanded
417// at load time both in agent.instruction and in toolsets[*].instruction.

Callers

nothing calls this directly

Calls 8

ResolveFunction · 0.92
GetInstructionsFunction · 0.92
withTestProviderRegistryFunction · 0.85
ContextMethod · 0.80
AgentMethod · 0.80
ToolSetsMethod · 0.80
LoadFunction · 0.70
LenMethod · 0.65

Tested by

no test coverage detected