mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-11-28 21:03:34 +08:00
- Preserve media from Gemini function responses in OpenAI, Codex, and Interactions translations. - Preserve case-only OAuth model aliases. Closes: #7618 Closes: #7621
46 lines
1.5 KiB
Go
46 lines
1.5 KiB
Go
package diff
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/router-for-me/CLIProxyAPI/v8/internal/config"
|
|
)
|
|
|
|
func TestDiffOAuthModelAliasChanges_IncludesDisplayName(t *testing.T) {
|
|
oldMap := map[string][]config.OAuthModelAlias{
|
|
"antigravity": {
|
|
{Name: "claude-opus-4-6-thinking", Alias: "claude-antigravity-opus-4-6-thinking", DisplayName: "Antigravity Opus 4.6"},
|
|
},
|
|
}
|
|
newMap := map[string][]config.OAuthModelAlias{
|
|
"antigravity": {
|
|
{Name: "claude-opus-4-6-thinking", Alias: "claude-antigravity-opus-4-6-thinking", DisplayName: "Antigravity Opus 4.6 (Thinking)"},
|
|
},
|
|
}
|
|
|
|
changes, affected := DiffOAuthModelAliasChanges(oldMap, newMap)
|
|
expectContains(t, changes, "oauth-model-alias[antigravity]: updated (1 -> 1 entries)")
|
|
if len(affected) != 1 || affected[0] != "antigravity" {
|
|
t.Fatalf("expected antigravity to be affected, got %#v", affected)
|
|
}
|
|
}
|
|
|
|
func TestDiffOAuthModelAliasChanges_DetectsCaseOnlyChange(t *testing.T) {
|
|
oldMap := map[string][]config.OAuthModelAlias{
|
|
"opencode-go": {
|
|
{Name: "minimax-m3.1-flash", Alias: "minimax-m3.1-flash"},
|
|
},
|
|
}
|
|
newMap := map[string][]config.OAuthModelAlias{
|
|
"opencode-go": {
|
|
{Name: "minimax-m3.1-flash", Alias: "MiniMax-M3.1-Flash"},
|
|
},
|
|
}
|
|
|
|
changes, affected := DiffOAuthModelAliasChanges(oldMap, newMap)
|
|
expectContains(t, changes, "oauth-model-alias[opencode-go]: updated (1 -> 1 entries)")
|
|
if len(affected) != 1 || affected[0] != "opencode-go" {
|
|
t.Fatalf("expected opencode-go to be affected, got %#v", affected)
|
|
}
|
|
}
|