Files
compute-engine/router/retired_frontend_routes_test.go
Pine 28e53d90fc feat: 算力引擎 Go 后端核心(new-api)
- 统一 OpenAI 兼容 /v1 中继 + 渠道/额度/令牌/流水
- 各领域包:relay 模型网关、model 数据层、controller 管理 API
2026-08-23 22:38:46 +08:00

27 lines
731 B
Go

package router
import (
"net/http"
"testing"
"github.com/gin-gonic/gin"
"github.com/stretchr/testify/assert"
)
func TestRetiredFrontendAPIRoutes(t *testing.T) {
gin.SetMode(gin.TestMode)
engine := gin.New()
SetApiRouter(engine)
routes := make(map[string]struct{}, len(engine.Routes()))
for _, route := range engine.Routes() {
routes[route.Method+" "+route.Path] = struct{}{}
}
_, hasAsyncCleanup := routes[http.MethodPost+" /api/system-task/log-cleanup"]
_, hasDirectDelete := routes[http.MethodDelete+" /api/log/"]
_, hasConsoleMigration := routes[http.MethodPost+" /api/option/migrate_console_setting"]
assert.True(t, hasAsyncCleanup)
assert.False(t, hasDirectDelete)
assert.False(t, hasConsoleMigration)
}