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

Function getJSONAtt

internal/httpapi/attachment_endpoint_test.go:91–105  ·  view source on GitHub ↗
(t *testing.T, url, bearer string)

Source from the content-addressed store, hash-verified

89}
90
91func getJSONAtt(t *testing.T, url, bearer string) (int, map[string]any) {
92 t.Helper()
93 req, _ := http.NewRequest("GET", url, nil)
94 if bearer != "" {
95 req.Header.Set("Authorization", "Bearer "+bearer)
96 }
97 resp, err := http.DefaultClient.Do(req)
98 if err != nil {
99 t.Fatal(err)
100 }
101 defer resp.Body.Close()
102 var body map[string]any
103 json.NewDecoder(resp.Body).Decode(&body)
104 return resp.StatusCode, body
105}
106
107func TestAttachment_MetadataAndSignedURL(t *testing.T) {
108 srv := attTestServer(t)

Calls 1

CloseMethod · 0.45

Tested by

no test coverage detected