MCPcopy Create free account
hub / github.com/PerpetualSoftware/pad / pathErrorCode

Function pathErrorCode

internal/server/middleware_request_text_test.go:42–53  ·  view source on GitHub ↗
(t *testing.T, rr *httptest.ResponseRecorder)

Source from the content-addressed store, hash-verified

40}
41
42func pathErrorCode(t *testing.T, rr *httptest.ResponseRecorder) string {
43 t.Helper()
44 var body struct {
45 Error struct {
46 Code string `json:"code"`
47 } `json:"error"`
48 }
49 if err := json.Unmarshal(rr.Body.Bytes(), &body); err != nil {
50 t.Fatalf("decode error body %q: %v", rr.Body.String(), err)
51 }
52 return body.Error.Code
53}
54
55// TestValidatePathRejectsUnbindablePathText drives the REAL server (not
56// ValidatePath directly) so it vouches for the middleware's BINDING as well

Calls 3

HelperMethod · 0.80
FatalfMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected