Files
sub2api/backend/internal/handler/ops_platform_test.go
T

17 lines
494 B
Go
Raw Normal View History

package handler
import (
"context"
"testing"
"github.com/Wei-Shaw/sub2api/internal/service"
"github.com/stretchr/testify/require"
)
func TestResolveOpsPlatformPrefersResolvedCompositeTarget(t *testing.T) {
apiKey := &service.APIKey{Group: &service.Group{Platform: service.PlatformComposite}}
ctx := service.WithResolvedTargetPlatform(context.Background(), service.PlatformOpenAI)
require.Equal(t, service.PlatformOpenAI, resolveOpsPlatform(ctx, apiKey, service.PlatformAnthropic))
}