MCPcopy Create free account
hub / github.com/gotify/server / TestBindingErrorDefault

Function TestBindingErrorDefault

error/handler_test.go:27–36  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

25}
26
27func TestBindingErrorDefault(t *testing.T) {
28 mode.Set(mode.TestDev)
29 rec := httptest.NewRecorder()
30 ctx, _ := gin.CreateTestContext(rec)
31 ctx.AbortWithError(400, errors.New("you need todo something")).SetType(gin.ErrorTypeBind)
32
33 Handler()(ctx)
34
35 assertJSONResponse(t, rec, 400, `{"errorCode":400, "errorDescription":"you need todo something", "error":"Bad Request"}`)
36}
37
38func TestDefaultErrorBadRequest(t *testing.T) {
39 mode.Set(mode.TestDev)

Callers

nothing calls this directly

Calls 3

SetFunction · 0.92
HandlerFunction · 0.85
assertJSONResponseFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…