Initial commit of Descrybe v2 without local scratch artifacts.
Drop one-shot tmp/axe scripts and agent i18n scratch so the Gitea tree is deployable.
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
package httpapi
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
)
|
||||
|
||||
// TestRouterV1MCPInstallGone locks MCP removal: GET /api/v1/mcp/install.json
|
||||
// must be absent from the public router (chi 404), not a live install snippet.
|
||||
func TestRouterV1MCPInstallGone(t *testing.T) {
|
||||
t.Parallel()
|
||||
s := testAPIServer()
|
||||
h := s.Router()
|
||||
|
||||
rec := httptest.NewRecorder()
|
||||
h.ServeHTTP(rec, httptest.NewRequest(http.MethodGet, "/api/v1/mcp/install.json", nil))
|
||||
if rec.Code != http.StatusNotFound {
|
||||
t.Fatalf("mcp install status=%d want 404 body=%s", rec.Code, rec.Body.String())
|
||||
}
|
||||
|
||||
// OpenAPI must remain public after MCP removal.
|
||||
openAPI := httptest.NewRecorder()
|
||||
h.ServeHTTP(openAPI, httptest.NewRequest(http.MethodGet, "/api/v1/openapi.yaml", nil))
|
||||
if openAPI.Code != http.StatusOK {
|
||||
t.Fatalf("openapi status=%d want 200", openAPI.Code)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user