From 8b0a18dbc310c41c1ce05e57ca7e48ad15ec7247 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=BE=99=200668001470?= Date: Mon, 16 Mar 2026 15:12:18 +0800 Subject: [PATCH] test(provider): satisfy golines in anthropic normalization coverage --- pkg/providers/openai_compat/provider_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/providers/openai_compat/provider_test.go b/pkg/providers/openai_compat/provider_test.go index b8f663855..d0947523e 100644 --- a/pkg/providers/openai_compat/provider_test.go +++ b/pkg/providers/openai_compat/provider_test.go @@ -511,13 +511,15 @@ func TestProviderChat_AcceptsNumericOptionTypes(t *testing.T) { } func TestNormalizeModel_UsesAPIBase(t *testing.T) { + const anthropicAPIBase = "https://api.anthropic.com/v1" + if got := normalizeModel("deepseek/deepseek-chat", "https://api.deepseek.com/v1"); got != "deepseek-chat" { t.Fatalf("normalizeModel(deepseek) = %q, want %q", got, "deepseek-chat") } - if got := normalizeModel("claude-sonnet-4.6", "https://api.anthropic.com/v1"); got != "claude-sonnet-4-6" { + if got := normalizeModel("claude-sonnet-4.6", anthropicAPIBase); got != "claude-sonnet-4-6" { t.Fatalf("normalizeModel(anthropic plain) = %q, want %q", got, "claude-sonnet-4-6") } - if got := normalizeModel("anthropic/claude-sonnet-4.6", "https://api.anthropic.com/v1"); got != "claude-sonnet-4-6" { + if got := normalizeModel("anthropic/claude-sonnet-4.6", anthropicAPIBase); got != "claude-sonnet-4-6" { t.Fatalf("normalizeModel(anthropic prefixed) = %q, want %q", got, "claude-sonnet-4-6") } if got := normalizeModel("openrouter/auto", "https://openrouter.ai/api/v1"); got != "openrouter/auto" {