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

Function TestPrepareUserMessage_CommandResolution

pkg/cli/runner_test.go:462–483  ·  view source on GitHub ↗

TestPrepareUserMessage_CommandResolution tests that commands are resolved correctly before agent switching.

(t *testing.T)

Source from the content-addressed store, hash-verified

460// TestPrepareUserMessage_CommandResolution tests that commands are resolved
461// correctly before agent switching.
462func TestPrepareUserMessage_CommandResolution(t *testing.T) {
463 t.Parallel()
464
465 rt := &mockRuntimeWithOverrides{
466 mockRuntime: &mockRuntime{},
467 }
468 rt.currentAgentInfoFn = func(context.Context) runtime.CurrentAgentInfo {
469 return runtime.CurrentAgentInfo{
470 Name: "test",
471 Commands: map[string]types.Command{
472 "fix": {
473 Instruction: "Fix the file ${args[0]}",
474 },
475 },
476 }
477 }
478
479 msg, _, err := PrepareUserMessage(t.Context(), rt, "/fix main.go", "")
480 assert.NilError(t, err)
481
482 assert.Equal(t, "Fix the file main.go", msg.Message.Content, "Command should be resolved with args")
483}

Callers

nothing calls this directly

Calls 2

PrepareUserMessageFunction · 0.85
ContextMethod · 0.80

Tested by

no test coverage detected