Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 

32 řádky
1.1 KiB

  1. package controller
  2. import (
  3. "strings"
  4. "testing"
  5. "github.com/QuantumNous/new-api/common"
  6. "github.com/QuantumNous/new-api/constant"
  7. "github.com/QuantumNous/new-api/model"
  8. "github.com/stretchr/testify/require"
  9. )
  10. func TestTestChannelRejectsAsyncVideoChannels(t *testing.T) {
  11. channels := []*model.Channel{
  12. {Type: constant.ChannelTypeDoubaoVideoCompatibleAiping, Models: "doubao-seedance-2-0-260128", Status: common.ChannelStatusEnabled},
  13. {Type: constant.ChannelTypeDoubaoVideoCompatibleTianyiYun, Models: "cdance2.0-0611", Status: common.ChannelStatusEnabled},
  14. }
  15. for _, channel := range channels {
  16. result := testChannel(channel, "", "", false)
  17. require.Error(t, result.localErr)
  18. require.True(t, strings.Contains(result.localErr.Error(), "channel test is not supported"))
  19. }
  20. }
  21. func TestRequiredTaskChannelTypeForTianyiYunSeedanceModel(t *testing.T) {
  22. c := newControllerJSONContext(t, "/api/v3/contents/generations/tasks", `{"model":"cdance2.0-0611"}`)
  23. require.Equal(t, constant.ChannelTypeDoubaoVideoCompatibleTianyiYun, requiredTaskChannelTypeForRequest(c))
  24. }