MCPcopy Index your code
hub / github.com/aws/aws-lambda-go / TestWrappedSendFailure

Function TestWrappedSendFailure

cfn/wrap_test.go:191–207  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

189}
190
191func 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
209func extractResponseBody(t *testing.T, req *http.Request) Response {
210 assert.NotContains(t, req.Header, "Content-Type")

Callers

nothing calls this directly

Calls 1

lambdaWrapWithClientFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…