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

Function TestProxyError

pkg/api/proxy_test.go:35–44  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

33}
34
35func TestProxyError(t *testing.T) {
36 testServer(t, func(c *stdsdk.Client, p *structs.MockProvider) {
37 p.On("Proxy", "host", 5000, mock.Anything, structs.ProxyOptions{}).Return(fmt.Errorf("err1"))
38 r, err := c.Websocket("/proxy/host/5000", stdsdk.RequestOptions{})
39 require.NoError(t, err)
40 d, err := io.ReadAll(r)
41 require.NoError(t, err)
42 require.Equal(t, []byte("ERROR: err1\n"), d)
43 })
44}

Callers

nothing calls this directly

Calls 2

WebsocketMethod · 0.80
testServerFunction · 0.70

Tested by

no test coverage detected