mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-09-05 23:50:29 +08:00
- Introduced `display-name` field for human-readable model names in config and YAML files. - Updated alias application logic to set and preserve display names during model alias mapping. - Enhanced tests to validate display name behavior for various scenarios, including forks and upstream preservation. - Refined `sanitizeOAuthModelAlias` to handle `display-name` with proper trimming and formatting. Closes: #4398
27 lines
861 B
Go
27 lines
861 B
Go
package diff
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/router-for-me/CLIProxyAPI/v7/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)
|
|
}
|
|
}
|