(t *testing.T)
| 189 | } |
| 190 | |
| 191 | func TestWrappedSendFailure(t *testing.T) { |
| 192 | client := &mockClient{ |
| 193 | DoFunc: func(req *http.Request) (*http.Response, error) { |
| 194 | return &http.Response{ |
| 195 | StatusCode: http.StatusForbidden, |
| 196 | }, errors.New("things went wrong") |
| 197 | }, |
| 198 | } |
| 199 | |
| 200 | fn := func(ctx context.Context, event Event) (physicalResourceID string, data map[string]interface{}, err error) { |
| 201 | return |
| 202 | } |
| 203 | |
| 204 | r, e := lambdaWrapWithClient(fn, client)(context.TODO(), *testEvent) |
| 205 | assert.NotNil(t, e) |
| 206 | assert.Equal(t, "things went wrong", r) |
| 207 | } |
| 208 | |
| 209 | func extractResponseBody(t *testing.T, req *http.Request) Response { |
| 210 | assert.NotContains(t, req.Header, "Content-Type") |
nothing calls this directly
no test coverage detected
searching dependent graphs…