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

Function TestExecuteOnUserInput

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

Source from the content-addressed store, hash-verified

526}
527
528func TestExecuteOnUserInput(t *testing.T) {
529 t.Parallel()
530
531 config := &Config{
532 OnUserInput: []Hook{
533 {Type: HookTypeCommand, Command: "echo 'user input needed'", Timeout: 5},
534 },
535 }
536
537 exec := NewExecutor(config, t.TempDir(), nil)
538 input := &Input{
539 SessionID: "test-session",
540 }
541
542 result, err := exec.Dispatch(t.Context(), EventOnUserInput, input)
543 require.NoError(t, err)
544 assert.True(t, result.Allowed)
545}
546
547func TestExecuteStop(t *testing.T) {
548 t.Parallel()

Callers

nothing calls this directly

Calls 3

DispatchMethod · 0.95
NewExecutorFunction · 0.85
ContextMethod · 0.80

Tested by

no test coverage detected