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

Function TestNewHandler_EmptyObjectArguments

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

Source from the content-addressed store, hash-verified

54}
55
56func TestNewHandler_EmptyObjectArguments(t *testing.T) {
57 t.Parallel()
58
59 handler := NewHandler(func(_ context.Context, _ map[string]any) (*ToolCallResult, error) {
60 return ResultSuccess("ok"), nil
61 })
62
63 result, err := handler(t.Context(), ToolCall{
64 ID: "call_1",
65 Type: "function",
66 Function: FunctionCall{
67 Name: "list_things",
68 Arguments: "{}",
69 },
70 })
71 require.NoError(t, err)
72 assert.Equal(t, "ok", result.Output)
73}
74
75func TestNewHandler_InvalidArguments(t *testing.T) {
76 t.Parallel()

Callers

nothing calls this directly

Calls 3

ResultSuccessFunction · 0.85
ContextMethod · 0.80
NewHandlerFunction · 0.70

Tested by

no test coverage detected