ops_platform_test.go 494 B

12345678910111213141516
  1. package handler
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/Wei-Shaw/sub2api/internal/service"
  6. "github.com/stretchr/testify/require"
  7. )
  8. func TestResolveOpsPlatformPrefersResolvedCompositeTarget(t *testing.T) {
  9. apiKey := &service.APIKey{Group: &service.Group{Platform: service.PlatformComposite}}
  10. ctx := service.WithResolvedTargetPlatform(context.Background(), service.PlatformOpenAI)
  11. require.Equal(t, service.PlatformOpenAI, resolveOpsPlatform(ctx, apiKey, service.PlatformAnthropic))
  12. }