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

Function TestSpecServedOverHTTP

internal/httpapi/spec_test.go:132–148  ·  view source on GitHub ↗

TestSpecServedOverHTTP confirms the spec is reachable at the versioned path so SDK/MCP codegen and the docs renderer can fetch it from a running instance.

(t *testing.T)

Source from the content-addressed store, hash-verified

130// path so SDK/MCP codegen and the docs renderer can fetch it from a running
131// instance.
132func TestSpecServedOverHTTP(t *testing.T) {
133 srv := httptest.NewServer(New(Deps{}))
134 defer srv.Close()
135
136 resp, err := http.Get(srv.URL + "/v1/openapi.yaml")
137 if err != nil {
138 t.Fatal(err)
139 }
140 defer resp.Body.Close()
141 if resp.StatusCode != 200 {
142 t.Fatalf("status: %d", resp.StatusCode)
143 }
144 b, _ := io.ReadAll(resp.Body)
145 if !strings.Contains(string(b), "openapi: 3.1.0") {
146 t.Fatalf("served spec is not OpenAPI 3.1: %.80s", b)
147 }
148}

Callers

nothing calls this directly

Calls 4

CloseMethod · 0.95
NewFunction · 0.70
GetMethod · 0.65
CloseMethod · 0.45

Tested by

no test coverage detected