mirror of
https://github.com/QuantumNous/new-api.git
synced 2026-09-01 19:41:57 +00:00
19 lines
467 B
Go
19 lines
467 B
Go
package relay
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestGetTaskPlatformPriority(t *testing.T) {
|
|
c, _ := gin.CreateTestContext(nil)
|
|
c.Set("platform", "fallback")
|
|
assert.Equal(t, "fallback", string(GetTaskPlatform(c)))
|
|
c.Set("channel_type", 59)
|
|
assert.Equal(t, "59", string(GetTaskPlatform(c)))
|
|
c.Set("task_plugin_key", "document-parser")
|
|
assert.Equal(t, "document-parser", string(GetTaskPlatform(c)))
|
|
}
|