MCPcopy
hub / github.com/gofiber/fiber / Test_App_serverErrorHandler_Unsupported_Method_Error

Function Test_App_serverErrorHandler_Unsupported_Method_Error

app_test.go:741–749  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

739}
740
741func Test_App_serverErrorHandler_Unsupported_Method_Error(t *testing.T) {
742 t.Parallel()
743 app := New()
744 c := app.AcquireCtx(&fasthttp.RequestCtx{}).(*DefaultCtx) //nolint:errcheck,forcetypeassert // not needed
745
746 app.serverErrorHandler(c.fasthttp, errors.New("unsupported http request method 'FOO'"))
747 require.Equal(t, utils.StatusMessage(StatusNotImplemented), string(c.fasthttp.Response.Body()))
748 require.Equal(t, StatusNotImplemented, c.fasthttp.Response.StatusCode())
749}
750
751func Test_App_serverErrorHandler_Unsupported_Method_Request(t *testing.T) {
752 t.Parallel()

Callers

nothing calls this directly

Calls 6

AcquireCtxMethod · 0.80
serverErrorHandlerMethod · 0.80
NewFunction · 0.70
NewMethod · 0.65
BodyMethod · 0.65
StatusCodeMethod · 0.45

Tested by

no test coverage detected