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

Function getListWithChatHeader

agent/agentproc/api_test.go:717–730  ·  view source on GitHub ↗

getListWithChatHeader sends a GET /list request with the Coder-Chat-Id header set and returns the recorder.

(t *testing.T, handler http.Handler, chatID string)

Source from the content-addressed store, hash-verified

715// getListWithChatHeader sends a GET /list request with the
716// Coder-Chat-Id header set and returns the recorder.
717func getListWithChatHeader(t *testing.T, handler http.Handler, chatID string) *httptest.ResponseRecorder {
718 t.Helper()
719
720 ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
721 defer cancel()
722
723 w := httptest.NewRecorder()
724 r := httptest.NewRequestWithContext(ctx, http.MethodGet, "/list", nil)
725 if chatID != "" {
726 r.Header.Set(workspacesdk.CoderChatIDHeader, chatID)
727 }
728 handler.ServeHTTP(w, r)
729 return w
730}
731
732func TestProcessOutput(t *testing.T) {
733 t.Parallel()

Callers 2

TestListProcessesFunction · 0.85

Calls 3

HelperMethod · 0.65
SetMethod · 0.65
ServeHTTPMethod · 0.45

Tested by

no test coverage detected