(t *testing.T)
| 134 | } |
| 135 | |
| 136 | func 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 | |
| 149 | func TestAttachment_IndexOutOfRange(t *testing.T) { |
| 150 | srv := attTestServer(t) |
nothing calls this directly
no test coverage detected