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

Function TestExecuteSessionStart

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

Source from the content-addressed store, hash-verified

485}
486
487func TestExecuteSessionStart(t *testing.T) {
488 t.Parallel()
489
490 config := &Config{
491 SessionStart: []Hook{
492 {Type: HookTypeCommand, Command: "echo 'session starting'", Timeout: 5},
493 },
494 }
495
496 exec := NewExecutor(config, t.TempDir(), nil)
497 input := &Input{
498 SessionID: "test-session",
499 Source: "startup",
500 }
501
502 result, err := exec.Dispatch(t.Context(), EventSessionStart, input)
503 require.NoError(t, err)
504 assert.True(t, result.Allowed)
505 assert.Contains(t, result.AdditionalContext, "session starting")
506}
507
508func TestExecuteSessionEnd(t *testing.T) {
509 t.Parallel()

Callers

nothing calls this directly

Calls 3

DispatchMethod · 0.95
NewExecutorFunction · 0.85
ContextMethod · 0.80

Tested by

no test coverage detected