MCPcopy Create free account
hub / github.com/celer-pkg/celer / TestStore_GitRepo

Function TestStore_GitRepo

pkgcache/cache_repo_test.go:264–280  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

262}
263
264func TestStore_GitRepo(t *testing.T) {
265 tmpDir, pkgCacheDir, _ := setupTestEnv(t)
266 rc := newRepoConfig(pkgCacheDir, true)
267
268 repoDir, commitHash := createGitRepo(t, tmpDir)
269 repoURL := "https://example.com/lib.git"
270
271 stored, err := rc.Store("x264@stable", repoURL, repoDir, "")
272 if err != nil {
273 t.Fatal(err)
274 }
275
276 expected := filepath.Join(pkgCacheDir, "repos", "x264@stable", commitHash+".tar.gz")
277 if stored != expected {
278 t.Fatalf("expected stored path %s, got %s", expected, stored)
279 }
280}
281
282// ---- Restore tests ----
283

Callers

nothing calls this directly

Calls 4

setupTestEnvFunction · 0.85
newRepoConfigFunction · 0.85
createGitRepoFunction · 0.85
StoreMethod · 0.65

Tested by

no test coverage detected