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

Function TestFetchModelsFromURL_EmptyDataArray

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

Source from the content-addressed store, hash-verified

233}
234
235func TestFetchModelsFromURL_EmptyDataArray(t *testing.T) {
236 t.Parallel()
237
238 server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
239 w.Header().Set("Content-Type", "application/json")
240 _, err := w.Write([]byte(`{"object":"list","data":[]}`))
241 assert.NoError(t, err)
242 }))
243 t.Cleanup(server.Close)
244
245 models := fetchModelsFromURL(t.Context(), server.URL+"/v1/models", server.Client())
246 assert.Empty(t, models)
247}
248
249func TestFetchModelsFromURL_DuplicateIDs(t *testing.T) {
250 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