From cfa36c65de06a146b140cfd5dd2b890c2cc4cc4d Mon Sep 17 00:00:00 2001 From: Eric Phillips Date: Tue, 21 Apr 2026 08:30:14 -0600 Subject: [PATCH] fixed tests to match refactor of config --- internal/cache/cache_test.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/internal/cache/cache_test.go b/internal/cache/cache_test.go index fcf353b..9b05c76 100644 --- a/internal/cache/cache_test.go +++ b/internal/cache/cache_test.go @@ -19,9 +19,10 @@ func newTestServer(t *testing.T, handler http.HandlerFunc) *httptest.Server { return svr } -func newTestCache(t *testing.T, mirrorURL string) *Cache { +func newTestCache(t *testing.T, mirrorURL []string) *Cache { t.Helper() - return NewCache(t.TempDir(), mirrorURL) + mirroredRepos := []string{"core", "extra"} + return NewCache(t.TempDir(), mirrorURL, mirroredRepos) } func TestFetchFileExists(t *testing.T) { @@ -31,7 +32,7 @@ func TestFetchFileExists(t *testing.T) { fmt.Fprint(w, expected) })) - c := newTestCache(t, svr.URL+"/") + c := newTestCache(t, []string{svr.URL + "/"}) err := c.Fetch("fakefile") if err != nil { @@ -54,7 +55,7 @@ func TestFetchNotFound(t *testing.T) { w.WriteHeader(http.StatusNotFound) })) - c := newTestCache(t, svr.URL+"/") + c := newTestCache(t, []string{svr.URL + "/"}) err := c.Fetch("fakefile") var upstreamErr *UpstreamError @@ -71,7 +72,7 @@ func TestFetchSrvError(t *testing.T) { w.WriteHeader(http.StatusInternalServerError) })) - c := newTestCache(t, svr.URL+"/") + c := newTestCache(t, []string{svr.URL + "/"}) err := c.Fetch("fakefile") var upstreamErr *UpstreamError @@ -94,7 +95,7 @@ func TestFetchSrvDead(t *testing.T) { })) defer svr.Close() - c := newTestCache(t, svr.URL+"/") + c := newTestCache(t, []string{svr.URL + "/"}) err := c.Fetch("fakefile") if err == nil {