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

Function TestExecutePostToolUse

pkg/hooks/hooks_test.go:460–485  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

458}
459
460func TestExecutePostToolUse(t *testing.T) {
461 t.Parallel()
462
463 config := &Config{
464 PostToolUse: []MatcherConfig{
465 {
466 Matcher: "shell",
467 Hooks: []Hook{
468 {Type: HookTypeCommand, Command: "echo 'post-hook'", Timeout: 5},
469 },
470 },
471 },
472 }
473
474 exec := NewExecutor(config, t.TempDir(), nil)
475 input := &Input{
476 SessionID: "test-session",
477 ToolName: "shell",
478 ToolUseID: "test-id",
479 ToolResponse: "command output",
480 }
481
482 result, err := exec.Dispatch(t.Context(), EventPostToolUse, input)
483 require.NoError(t, err)
484 assert.True(t, result.Allowed)
485}
486
487func TestExecuteSessionStart(t *testing.T) {
488 t.Parallel()

Callers

nothing calls this directly

Calls 3

DispatchMethod · 0.95
NewExecutorFunction · 0.85
ContextMethod · 0.80

Tested by

no test coverage detected