MCPcopy Index your code
hub / github.com/coder/coder / assertHandlerBody

Function assertHandlerBody

coderd/aibridged/pool_test.go:330–343  ·  view source on GitHub ↗
(t *testing.T, handler http.Handler, path string, body string)

Source from the content-addressed store, hash-verified

328}
329
330func assertHandlerBody(t *testing.T, handler http.Handler, path string, body string) {
331 t.Helper()
332
333 req := httptest.NewRequest(http.MethodGet, path, nil)
334 rw := httptest.NewRecorder()
335 handler.ServeHTTP(rw, req)
336 resp := rw.Result()
337 defer resp.Body.Close()
338
339 got, err := io.ReadAll(resp.Body)
340 require.NoError(t, err)
341 require.Equal(t, http.StatusOK, resp.StatusCode)
342 require.Equal(t, body, string(got))
343}
344
345var _ aibridged.MCPProxyBuilder = &mockMCPFactory{}
346

Calls 6

HelperMethod · 0.65
CloseMethod · 0.65
ServeHTTPMethod · 0.45
ResultMethod · 0.45
ReadAllMethod · 0.45
EqualMethod · 0.45

Tested by

no test coverage detected