Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 

37 строки
1.2 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/QuantumNous/new-api/service"
  9. "github.com/stretchr/testify/require"
  10. )
  11. func TestTestChannelRejectsAsyncVideoChannels(t *testing.T) {
  12. channels := []*model.Channel{
  13. {Type: constant.ChannelTypeDoubaoVideoCompatibleAiping, Models: "doubao-seedance-2-0-260128", Status: common.ChannelStatusEnabled},
  14. {Type: constant.ChannelTypeDoubaoVideoCompatibleTianyiYun, Models: "cdance2.0-0611", Status: common.ChannelStatusEnabled},
  15. }
  16. for _, channel := range channels {
  17. result := testChannel(channel, "", "", false)
  18. require.Error(t, result.localErr)
  19. require.True(t, strings.Contains(result.localErr.Error(), "channel test is not supported"))
  20. }
  21. }
  22. func TestRequiredTaskChannelTypeForTianyiYunSeedanceModelUsesAllowedFamily(t *testing.T) {
  23. c := newControllerJSONContext(t, "/api/v3/contents/generations/tasks", `{"model":"Doubao-Seedance-2.0"}`)
  24. require.Equal(t, 0, requiredTaskChannelTypeForRequest(c))
  25. require.ElementsMatch(t,
  26. service.VideoAssetChannelTypesForFamily(service.VideoAssetFamilySeedance),
  27. allowedTaskChannelTypesForRequest(c),
  28. )
  29. }