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

Function TestElicitationHandler_NonInteractive

pkg/runtime/runtime_test.go:4025–4043  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

4023}
4024
4025func TestElicitationHandler_NonInteractive(t *testing.T) {
4026 t.Parallel()
4027
4028 prov := &mockProvider{id: "test/mock-model", stream: newStreamBuilder().AddContent("ok").AddStopWithUsage(1, 1).Build()}
4029 root := agent.New("root", "test", agent.WithModel(prov))
4030 tm := team.New(team.WithAgents(root))
4031
4032 rt, err := NewLocalRuntime(t.Context(), tm, WithNonInteractive(true))
4033 require.NoError(t, err)
4034
4035 params := &mcp.ElicitParams{
4036 Message: "Authorize OAuth?",
4037 }
4038
4039 result, err := rt.elicitationHandler(t.Context(), params)
4040
4041 require.NoError(t, err)
4042 assert.Equal(t, tools.ElicitationActionDecline, result.Action, "non-interactive runtime should decline elicitation")
4043}
4044
4045func TestElicitationHandler_Interactive_NoChannel(t *testing.T) {
4046 t.Parallel()

Callers

nothing calls this directly

Calls 11

elicitationHandlerMethod · 0.95
NewFunction · 0.92
NewFunction · 0.92
WithAgentsFunction · 0.92
newStreamBuilderFunction · 0.85
NewLocalRuntimeFunction · 0.85
AddStopWithUsageMethod · 0.80
ContextMethod · 0.80
WithNonInteractiveFunction · 0.70
BuildMethod · 0.45
AddContentMethod · 0.45

Tested by

no test coverage detected