MCPcopy Create free account
hub / github.com/convox/rack / TestExecError

Function TestExecError

pkg/cli/exec_test.go:35–46  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

33}
34
35func TestExecError(t *testing.T) {
36 testClient(t, func(e *cli.Engine, i *mocksdk.Interface) {
37 opts := structs.ProcessExecOptions{Tty: options.Bool(false)}
38 i.On("ProcessExec", "app1", "0123456789", "bash", mock.Anything, opts).Return(0, fmt.Errorf("err1"))
39
40 res, err := testExecute(e, "exec 0123456789 bash -a app1", strings.NewReader("in"))
41 require.NoError(t, err)
42 require.Equal(t, 1, res.Code)
43 res.RequireStderr(t, []string{"ERROR: err1"})
44 res.RequireStdout(t, []string{""})
45 })
46}

Callers

nothing calls this directly

Calls 5

BoolFunction · 0.92
testClientFunction · 0.85
testExecuteFunction · 0.85
RequireStderrMethod · 0.80
RequireStdoutMethod · 0.80

Tested by

no test coverage detected