TestNoPredicateAlwaysAllowsFetch guards the default, backwards-compatible behaviour: with no knownProvider predicate every provider may fetch.
(t *testing.T)
| 83 | // TestNoPredicateAlwaysAllowsFetch guards the default, backwards-compatible |
| 84 | // behaviour: with no knownProvider predicate every provider may fetch. |
| 85 | func TestNoPredicateAlwaysAllowsFetch(t *testing.T) { |
| 86 | t.Parallel() |
| 87 | |
| 88 | cacheFile := filepath.Join(t.TempDir(), "models_dev.json") |
| 89 | fetched, fetch := trackingFetcher() |
| 90 | store, err := NewStore(WithCache(cacheFile), WithFetcher(fetch)) |
| 91 | require.NoError(t, err) |
| 92 | |
| 93 | _, _ = store.GetModel(expiredContext(t), NewID("mistral_gateway", "mistral-small-latest")) |
| 94 | assert.True(t, *fetched, "with no predicate, any provider may trigger a fetch") |
| 95 | } |
| 96 | |
| 97 | // TestFetchDisallowedServesFromCache checks the cache-only path: a provider the |
| 98 | // predicate rejects but that IS present in the on-disk cache resolves from the |
nothing calls this directly
no test coverage detected