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

Function TestFetchModelsFromURL_SkipsEmbeddingModels

cmd/root/models_test.go:302–319  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

300}
301
302func TestFetchModelsFromURL_SkipsEmbeddingModels(t *testing.T) {
303 // The function passes all model IDs through; embedding filtering
304 // is done at the caller level (collectModels). Verify IDs are intact.
305 t.Parallel()
306
307 server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
308 w.Header().Set("Content-Type", "application/json")
309 _, err := w.Write([]byte(`{"object":"list","data":[
310 {"id":"text-embedding-3"},
311 {"id":"gpt-5"}
312 ]}`))
313 assert.NoError(t, err)
314 }))
315 t.Cleanup(server.Close)
316
317 models := fetchModelsFromURL(t.Context(), server.URL+"/v1/models", server.Client())
318 assert.Equal(t, []string{"text-embedding-3", "gpt-5"}, models)
319}
320
321func TestModelsListCommand_NoCredentials(t *testing.T) {
322 t.Parallel()

Callers

nothing calls this directly

Calls 5

fetchModelsFromURLFunction · 0.85
ContextMethod · 0.80
CleanupMethod · 0.65
SetMethod · 0.45
WriteMethod · 0.45

Tested by

no test coverage detected