(t *testing.T)
| 94 | } |
| 95 | |
| 96 | func 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 | |
| 107 | func TestInstanceTerminate(t *testing.T) { |
| 108 | testServer(t, func(c *stdsdk.Client, p *structs.MockProvider) { |
nothing calls this directly
no test coverage detected