getOutput sends a GET /{id}/output request and returns the recorder.
(t *testing.T, handler http.Handler, id string)
| 70 | // getOutput sends a GET /{id}/output request and returns the |
| 71 | // recorder. |
| 72 | func getOutput(t *testing.T, handler http.Handler, id string) *httptest.ResponseRecorder { |
| 73 | t.Helper() |
| 74 | |
| 75 | ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong) |
| 76 | defer cancel() |
| 77 | |
| 78 | w := httptest.NewRecorder() |
| 79 | r := httptest.NewRequestWithContext(ctx, http.MethodGet, fmt.Sprintf("/%s/output", id), nil) |
| 80 | handler.ServeHTTP(w, r) |
| 81 | return w |
| 82 | } |
| 83 | |
| 84 | // getOutputWithHeaders sends a GET /{id}/output request with |
| 85 | // custom headers and returns the recorder. |
no test coverage detected