MCPcopy
hub / github.com/larksuite/cli / TestParseJSONResponse_Invalid

Function TestParseJSONResponse_Invalid

internal/client/response_test.go:75–81  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

73}
74
75func TestParseJSONResponse_Invalid(t *testing.T) {
76 resp := newApiResp([]byte(`not json`), map[string]string{"Content-Type": "application/json"})
77 _, err := ParseJSONResponse(resp)
78 if err == nil {
79 t.Error("expected error for invalid JSON")
80 }
81}
82
83func TestParseJSONResponse_EmptyBody_WrapsEOF(t *testing.T) {
84 resp := newApiResp([]byte{}, map[string]string{"Content-Type": "application/json"})

Callers

nothing calls this directly

Calls 3

newApiRespFunction · 0.85
ParseJSONResponseFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected