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:
parent
46a97d3256
commit
489a1122d5
1 changed files with 20 additions and 0 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue