mirror of
https://github.com/QuantumNous/new-api.git
synced 2026-09-12 07:00:42 +00:00
feat(task): replace built-in task adaptors with a sandboxed JS plugin system (#7076)
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
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)))
|
||||
}
|
||||
Reference in New Issue
Block a user