(status int, contentType, body string)
| 52 | } |
| 53 | |
| 54 | func stubResponse(status int, contentType, body string) func(*http.Request) (*http.Response, error) { |
| 55 | return func(r *http.Request) (*http.Response, error) { |
| 56 | return &http.Response{ |
| 57 | StatusCode: status, |
| 58 | Header: http.Header{"Content-Type": []string{contentType}}, |
| 59 | Body: io.NopCloser(strings.NewReader(body)), |
| 60 | Request: r, |
| 61 | }, nil |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | func requireCallAPIProblem(t *testing.T, err error, category errs.Category, subtype errs.Subtype) { |
| 66 | t.Helper() |
no outgoing calls
no test coverage detected