MCPcopy Index your code
hub / github.com/docker/docker-agent / TestHasCustomBaseURL

Function TestHasCustomBaseURL

pkg/config/model_alias_test.go:271–362  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

269}
270
271func TestHasCustomBaseURL(t *testing.T) {
272 t.Parallel()
273
274 tests := []struct {
275 name string
276 modelCfg *latest.ModelConfig
277 providers map[string]latest.ProviderConfig
278 expected bool
279 }{
280 {
281 name: "no base_url anywhere",
282 modelCfg: &latest.ModelConfig{
283 Provider: "anthropic",
284 Model: "claude-sonnet-4-5",
285 },
286 providers: nil,
287 expected: false,
288 },
289 {
290 name: "direct base_url on model",
291 modelCfg: &latest.ModelConfig{
292 Provider: "anthropic",
293 Model: "claude-sonnet-4-5",
294 BaseURL: "https://custom.example.com/v1",
295 },
296 providers: nil,
297 expected: true,
298 },
299 {
300 name: "base_url from provider",
301 modelCfg: &latest.ModelConfig{
302 Provider: "my_provider",
303 Model: "claude-sonnet-4-5",
304 },
305 providers: map[string]latest.ProviderConfig{
306 "my_provider": {
307 BaseURL: "https://custom.example.com/v1",
308 TokenKey: "MY_KEY",
309 },
310 },
311 expected: true,
312 },
313 {
314 name: "provider exists but no base_url",
315 modelCfg: &latest.ModelConfig{
316 Provider: "my_provider",
317 Model: "claude-sonnet-4-5",
318 },
319 providers: map[string]latest.ProviderConfig{
320 "my_provider": {
321 TokenKey: "MY_KEY",
322 // No BaseURL
323 },
324 },
325 expected: false,
326 },
327 {
328 name: "provider not found in providers map",

Callers

nothing calls this directly

Calls 2

hasCustomBaseURLFunction · 0.85
RunMethod · 0.65

Tested by

no test coverage detected