Publish Docker image (Multi-arch) / Build & push (amd64) (push) Failing after 1m40s
Release (Linux, macOS, Windows) / Linux Release (push) Failing after 42m16s
Publish Docker image (Multi-arch) / Build & push (arm64) (push) Canceled after 0s
Release (Linux, macOS, Windows) / macOS Release (push) Canceled after 0s
Release (Linux, macOS, Windows) / Windows Release (push) Canceled after 0s
Publish Docker image (Multi-arch) / Create multi-arch manifests (push) Canceled after 0s
Sync production source including routing, billing, Astra detection and public uptime. Update custom build instructions and license packaging.
32 lines
976 B
Go
32 lines
976 B
Go
package service
|
|
|
|
import (
|
|
"testing"
|
|
|
|
relaycommon "github.com/QuantumNous/new-api/relay/common"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestResolveAttemptGuardResultForDetectionOnly(t *testing.T) {
|
|
t.Run("matching declaration is verified", func(t *testing.T) {
|
|
info := &relaycommon.RelayInfo{ResponseModel: &relaycommon.ResponseModel{
|
|
RequestedModel: "gpt-6-astra",
|
|
ReturnedModel: "gpt-6-astra",
|
|
}}
|
|
require.Equal(t, "accepted", resolveAttemptGuardResult("", info))
|
|
})
|
|
|
|
t.Run("missing declaration remains unchecked", func(t *testing.T) {
|
|
require.Equal(t, "unchecked", resolveAttemptGuardResult("", &relaycommon.RelayInfo{}))
|
|
})
|
|
|
|
t.Run("allowed mismatch remains visible", func(t *testing.T) {
|
|
info := &relaycommon.RelayInfo{ResponseModel: &relaycommon.ResponseModel{
|
|
RequestedModel: "gpt-6-astra",
|
|
ReturnedModel: "gpt-5.6-luna",
|
|
Mismatch: true,
|
|
}}
|
|
require.Equal(t, "mismatch_allowed", resolveAttemptGuardResult("", info))
|
|
})
|
|
}
|