Based on QuantumNous/new-api v1.0.0-rc.36 (shallow history squashed). - CNY quota display mode: RMB-denominated top-up and crediting across Epay/Waffo channels - New CheckinButton in both authenticated and public headers (Turnstile supported) - New /subscribe page with public plan snapshot, Alipay/balance payment, auto group upgrade/reset - New /docs 12-section beginner guide with anchor navigation - New home PromoBanner linking to /docs; i18n synced (en/zh/zh-TW/fr/ja/ru/vi) - README: document custom features, live demo https://ai.88531.cn
32 lines
713 B
Go
32 lines
713 B
Go
package router
|
|
|
|
import (
|
|
"fmt"
|
|
"sort"
|
|
"testing"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestHostProtocolRegistryDrivesProtocolRoutesOnce(t *testing.T) {
|
|
engine := gin.New()
|
|
SetTaskPluginProtocolRouter(engine)
|
|
|
|
expected := []string{
|
|
"POST /v1/responses",
|
|
"GET /v1/responses/:response_id",
|
|
"POST /v1/videos",
|
|
"GET /v1/videos/:task_id",
|
|
"GET /v1/videos/:task_id/content",
|
|
"HEAD /v1/videos/:task_id/content",
|
|
}
|
|
actual := make([]string, 0, len(engine.Routes()))
|
|
for _, route := range engine.Routes() {
|
|
actual = append(actual, fmt.Sprintf("%s %s", route.Method, route.Path))
|
|
}
|
|
sort.Strings(expected)
|
|
sort.Strings(actual)
|
|
assert.Equal(t, expected, actual)
|
|
}
|