testCatalog is a tiny in-memory models.dev database used by the models-list tests so they never fetch the real catalog over the network or read the developer's on-disk cache.
()
| 28 | // tests so they never fetch the real catalog over the network or read the |
| 29 | // developer's on-disk cache. |
| 30 | func testCatalog() *modelsdev.Database { |
| 31 | return &modelsdev.Database{ |
| 32 | Providers: map[string]modelsdev.Provider{ |
| 33 | "anthropic": {Models: map[string]modelsdev.Model{ |
| 34 | "claude-sonnet-4-6": { |
| 35 | Name: "Claude Sonnet 4.6", |
| 36 | Modalities: modelsdev.Modalities{Output: []string{"text"}}, |
| 37 | }, |
| 38 | catalogOnlyModel: { |
| 39 | Name: "Claude Catalog Only", |
| 40 | Modalities: modelsdev.Modalities{Output: []string{"text"}}, |
| 41 | }, |
| 42 | }}, |
| 43 | "openai": {Models: map[string]modelsdev.Model{ |
| 44 | "gpt-5": { |
| 45 | Name: "GPT-5", |
| 46 | Modalities: modelsdev.Modalities{Output: []string{"text"}}, |
| 47 | }, |
| 48 | }}, |
| 49 | }, |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | // withTestConfig injects a hermetic env provider and an in-memory models.dev |
| 54 | // store into the models command. It keeps listing side-effect-free: without it |