MCPcopy
hub / github.com/docker/docker-agent / TestShellTool_HandlerWithCwd

Function TestShellTool_HandlerWithCwd

pkg/tools/builtin/shell/shell_test.go:47–60  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

45}
46
47func TestShellTool_HandlerWithCwd(t *testing.T) {
48 t.Parallel()
49 tool := New(nil, &config.RuntimeConfig{Config: config.Config{WorkingDir: t.TempDir()}})
50 tmpDir := t.TempDir()
51
52 result, err := tool.handler.RunShell(t.Context(), RunShellArgs{
53 Cmd: "pwd",
54 Cwd: tmpDir,
55 })
56 require.NoError(t, err)
57 // The output might contain extra newlines or other characters,
58 // so we just check if it contains the temp dir path
59 assert.Contains(t, result.Output, tmpDir)
60}
61
62func TestRunShellArgs_UnmarshalJSON_AcceptsCmdAndCommand(t *testing.T) {
63 t.Parallel()

Callers

nothing calls this directly

Calls 3

RunShellMethod · 0.80
ContextMethod · 0.80
NewFunction · 0.70

Tested by

no test coverage detected