test(provider/anthropic): add test for dotted model ID normalization

Cover the dot-to-dash normalization in anthropic_messages.buildRequestBody
with a regression test, as suggested in PR review.

Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com>
Signed-off-by: Pavel Anni <panni@redhat.com>
This commit is contained in:
Pavel Anni 2026-03-16 10:57:32 -04:00
parent 46a97d3256
commit 489a1122d5

View file

@ -179,6 +179,26 @@ func TestBuildRequestBody(t *testing.T) {
},
},
},
{
name: "dotted model ID is normalized to dashes",
messages: []Message{
{Role: "user", Content: "Hi"},
},
model: "claude-sonnet-4.6",
options: map[string]any{
"max_tokens": 1024,
},
want: map[string]any{
"model": "claude-sonnet-4-6",
"max_tokens": int64(1024),
"messages": []any{
map[string]any{
"role": "user",
"content": "Hi",
},
},
},
},
}
for _, tt := range tests {