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

Function TestInstanceShellError

pkg/api/instance_test.go:96–105  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

94}
95
96func TestInstanceShellError(t *testing.T) {
97 testServer(t, func(c *stdsdk.Client, p *structs.MockProvider) {
98 p.On("InstanceShell", "instance1", mock.Anything, structs.InstanceShellOptions{}).Return(0, fmt.Errorf("err1"))
99 r, err := c.Websocket("/instances/instance1/shell", stdsdk.RequestOptions{})
100 require.NoError(t, err)
101 d, err := io.ReadAll(r)
102 require.NoError(t, err)
103 require.Equal(t, []byte("ERROR: err1\n"), d)
104 })
105}
106
107func TestInstanceTerminate(t *testing.T) {
108 testServer(t, func(c *stdsdk.Client, p *structs.MockProvider) {

Callers

nothing calls this directly

Calls 2

WebsocketMethod · 0.80
testServerFunction · 0.70

Tested by

no test coverage detected