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

Function TestNewHandler_InvalidArguments

pkg/tools/tools_test.go:75–91  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

73}
74
75func TestNewHandler_InvalidArguments(t *testing.T) {
76 t.Parallel()
77
78 handler := NewHandler(func(_ context.Context, _ map[string]any) (*ToolCallResult, error) {
79 return ResultSuccess("ok"), nil
80 })
81
82 _, err := handler(t.Context(), ToolCall{
83 ID: "call_1",
84 Type: "function",
85 Function: FunctionCall{
86 Name: "broken",
87 Arguments: `{"unterminated`,
88 },
89 })
90 require.Error(t, err)
91}
92
93// The next three tests pin the docker-agent-specific behavior of NewHandler.
94// Repair semantics themselves are covered by github.com/docker/aijson; what

Callers

nothing calls this directly

Calls 4

ResultSuccessFunction · 0.85
ContextMethod · 0.80
NewHandlerFunction · 0.70
ErrorMethod · 0.45

Tested by

no test coverage detected