(t *testing.T)
| 300 | } |
| 301 | |
| 302 | func 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 | |
| 321 | func TestModelsListCommand_NoCredentials(t *testing.T) { |
| 322 | t.Parallel() |
nothing calls this directly
no test coverage detected