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

Function TestResolveCommand_ToolCommand

pkg/runtime/commands_test.go:228–247  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

226}
227
228func TestResolveCommand_ToolCommand(t *testing.T) {
229 t.Parallel()
230
231 rt := &mockRuntime{
232 commands: types.Commands{
233 "info": types.Command{Instruction: "Result: !echo_tool()"},
234 },
235 tools: []tools.Tool{
236 {
237 Name: "echo_tool",
238 Handler: func(_ context.Context, _ tools.ToolCall) (*tools.ToolCallResult, error) {
239 return tools.ResultSuccess("hello from tool"), nil
240 },
241 },
242 },
243 }
244
245 result := ResolveCommand(t.Context(), rt, "/info")
246 assert.Equal(t, "Result: hello from tool", result)
247}
248
249func TestResolveCommand_ToolCommandWithArgs(t *testing.T) {
250 t.Parallel()

Callers

nothing calls this directly

Calls 3

ResultSuccessFunction · 0.92
ResolveCommandFunction · 0.85
ContextMethod · 0.80

Tested by

no test coverage detected