|
- package controller
-
- import (
- "strings"
- "testing"
-
- "github.com/QuantumNous/new-api/common"
- "github.com/QuantumNous/new-api/constant"
- "github.com/QuantumNous/new-api/model"
- "github.com/stretchr/testify/require"
- )
-
- func TestTestChannelRejectsAsyncVideoChannels(t *testing.T) {
- channels := []*model.Channel{
- {Type: constant.ChannelTypeDoubaoVideoCompatibleAiping, Models: "doubao-seedance-2-0-260128", Status: common.ChannelStatusEnabled},
- {Type: constant.ChannelTypeDoubaoVideoCompatibleTianyiYun, Models: "cdance2.0-0611", Status: common.ChannelStatusEnabled},
- }
-
- for _, channel := range channels {
- result := testChannel(channel, "", "", false)
-
- require.Error(t, result.localErr)
- require.True(t, strings.Contains(result.localErr.Error(), "channel test is not supported"))
- }
- }
-
- func TestRequiredTaskChannelTypeForTianyiYunSeedanceModel(t *testing.T) {
- c := newControllerJSONContext(t, "/api/v3/contents/generations/tasks", `{"model":"cdance2.0-0611"}`)
-
- require.Equal(t, constant.ChannelTypeDoubaoVideoCompatibleTianyiYun, requiredTaskChannelTypeForRequest(c))
- }
|