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/QuantumNous/new-api/service" "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 TestRequiredTaskChannelTypeForTianyiYunSeedanceModelUsesAllowedFamily(t *testing.T) { c := newControllerJSONContext(t, "/api/v3/contents/generations/tasks", `{"model":"Doubao-Seedance-2.0"}`) require.Equal(t, 0, requiredTaskChannelTypeForRequest(c)) require.ElementsMatch(t, service.VideoAssetChannelTypesForFamily(service.VideoAssetFamilySeedance), allowedTaskChannelTypesForRequest(c), ) }