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

Function TestRequestContext

lambdaurl/http_handler_test.go:203–214  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

201}
202
203func TestRequestContext(t *testing.T) {
204 var req *events.LambdaFunctionURLRequest
205 require.NoError(t, json.Unmarshal(helloRequest, &req))
206 handler := Wrap(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
207 reqFromContext, exists := RequestFromContext(r.Context())
208 require.True(t, exists)
209 require.NotNil(t, reqFromContext)
210 assert.Equal(t, req, reqFromContext)
211 }))
212 _, err := handler(context.Background(), req)
213 require.NoError(t, err)
214}
215
216func TestStartViaEmulator(t *testing.T) {
217 addr1 := "localhost:" + strconv.Itoa(6001)

Callers

nothing calls this directly

Calls 3

WrapFunction · 0.85
RequestFromContextFunction · 0.85
handlerFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…