Fix linting

This commit is contained in:
Kunal Karmakar
2026-04-19 04:30:21 +00:00
parent c71146b1d5
commit e901e70c14
+30 -6
View File
@@ -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 {