MCPcopy Create free account
hub / github.com/daodst/chat / TestForbidden

Function TestForbidden

clientapi/jsonerror/jsonerror_test.go:34–44  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

32}
33
34func TestForbidden(t *testing.T) {
35 e := Forbidden("you shall not pass")
36 jsonBytes, err := json.Marshal(&e)
37 if err != nil {
38 t.Fatalf("TestForbidden: Failed to marshal Forbidden error. %s", err.Error())
39 }
40 want := `{"errcode":"M_FORBIDDEN","error":"you shall not pass"}`
41 if string(jsonBytes) != want {
42 t.Errorf("TestForbidden: want %s, got %s", want, string(jsonBytes))
43 }
44}

Callers

nothing calls this directly

Calls 2

ForbiddenFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected