mirror of
https://github.com/sipeed/picoclaw.git
synced 2026-06-12 18:08:54 +00:00
Fix linting
This commit is contained in:
@@ -706,12 +706,36 @@ func TestNormalizeAnthropicBaseURL(t *testing.T) {
|
||||
}{
|
||||
{"empty with v1", "", defaultURLWithV1, true, defaultURLWithV1},
|
||||
{"empty without v1", "", defaultURL, false, defaultURL},
|
||||
{"URL without v1 gets it appended", "https://api.example.com/anthropic", defaultURLWithV1, true, "https://api.example.com/anthropic/v1"},
|
||||
{"URL without v1 stays as-is", "https://api.example.com/anthropic", defaultURL, false, "https://api.example.com/anthropic"},
|
||||
{"URL with v1 remains unchanged when appending", "https://api.example.com/v1", defaultURLWithV1, true, "https://api.example.com/v1"},
|
||||
{"URL with v1 gets it stripped when not appending", "https://api.example.com/v1", defaultURL, false, "https://api.example.com"},
|
||||
{"trailing slash cleaned with v1", "https://api.example.com/anthropic/", defaultURLWithV1, true, "https://api.example.com/anthropic/v1"},
|
||||
{"trailing slash cleaned without v1", "https://api.example.com/anthropic/", defaultURL, false, "https://api.example.com/anthropic"},
|
||||
{
|
||||
"URL without v1 gets it appended",
|
||||
"https://api.example.com/anthropic", defaultURLWithV1,
|
||||
true, "https://api.example.com/anthropic/v1",
|
||||
},
|
||||
{
|
||||
"URL without v1 stays as-is",
|
||||
"https://api.example.com/anthropic", defaultURL,
|
||||
false, "https://api.example.com/anthropic",
|
||||
},
|
||||
{
|
||||
"URL with v1 remains unchanged when appending",
|
||||
"https://api.example.com/v1", defaultURLWithV1,
|
||||
true, "https://api.example.com/v1",
|
||||
},
|
||||
{
|
||||
"URL with v1 gets it stripped when not appending",
|
||||
"https://api.example.com/v1", defaultURL,
|
||||
false, "https://api.example.com",
|
||||
},
|
||||
{
|
||||
"trailing slash cleaned with v1",
|
||||
"https://api.example.com/anthropic/", defaultURLWithV1,
|
||||
true, "https://api.example.com/anthropic/v1",
|
||||
},
|
||||
{
|
||||
"trailing slash cleaned without v1",
|
||||
"https://api.example.com/anthropic/", defaultURL,
|
||||
false, "https://api.example.com/anthropic",
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
|
||||
Reference in New Issue
Block a user