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

Function TestAttachment_InlineTooLarge

internal/httpapi/attachment_endpoint_test.go:136–147  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

134}
135
136func TestAttachment_InlineTooLarge(t *testing.T) {
137 srv := attTestServer(t)
138 code, body := getJSONAtt(t, srv.URL+"/v1/agents/support%40acme.com/messages/msg_big/attachments/0?inline=true", "acct")
139 if code != http.StatusRequestEntityTooLarge || errCode(body) != "attachment_too_large" {
140 t.Fatalf("want 413 attachment_too_large, got %d %v", code, body)
141 }
142 // Without inline, the same big attachment still yields a download_url (no cap).
143 code2, body2 := getJSONAtt(t, srv.URL+"/v1/agents/support%40acme.com/messages/msg_big/attachments/0", "acct")
144 if code2 != 200 || body2["download_url"] == nil {
145 t.Fatalf("big attachment by URL should be 200 with download_url, got %d %v", code2, body2)
146 }
147}
148
149func TestAttachment_IndexOutOfRange(t *testing.T) {
150 srv := attTestServer(t)

Callers

nothing calls this directly

Calls 3

attTestServerFunction · 0.85
getJSONAttFunction · 0.85
errCodeFunction · 0.85

Tested by

no test coverage detected