MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / TestHandlerRejectsBadJSON

Function TestHandlerRejectsBadJSON

internal/delivery/handler_test.go:24–32  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

22}
23
24func TestHandlerRejectsBadJSON(t *testing.T) {
25 h := Handler(NewVerifier(nil, nil), NewConsumer(nil, nil))
26 r := httptest.NewRequest(http.MethodPost, "/x", strings.NewReader("{not json"))
27 w := httptest.NewRecorder()
28 h(w, r)
29 if w.Code != http.StatusBadRequest {
30 t.Fatalf("bad json: status=%d, want 400", w.Code)
31 }
32}
33
34func TestHandlerRejectsGET(t *testing.T) {
35 h := Handler(NewVerifier(nil, nil), NewConsumer(nil, nil))

Callers

nothing calls this directly

Calls 3

NewVerifierFunction · 0.85
NewConsumerFunction · 0.85
HandlerFunction · 0.70

Tested by

no test coverage detected