MCPcopy Index your code
hub / github.com/celer-pkg/celer / newTestDevArtifactCache

Function newTestDevArtifactCache

pkgcache/cache_dev_artifact_test.go:14–29  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

12)
13
14func newTestDevArtifactCache(t *testing.T) *DevArtifactCache {
15 t.Helper()
16
17 // Redirect workspace so TmpFilesDir is inside the sandbox.
18 oldWS := dirs.WorkspaceDir
19 tmpWS := t.TempDir()
20 dirs.Init(tmpWS)
21 t.Cleanup(func() { dirs.Init(oldWS) })
22
23 cacheDir := filepath.Join(tmpWS, "devcache")
24 if err := os.MkdirAll(cacheDir, os.ModePerm); err != nil {
25 t.Fatal(err)
26 }
27
28 return NewDevArtifactCache(fakeContext{}, cacheDir)
29}
30
31// makePackageDir creates a fake built package directory with a couple of files
32// inside, mimicking what doInstallFromSource leaves behind.

Calls 3

InitFunction · 0.92
NewDevArtifactCacheFunction · 0.85
MkdirAllMethod · 0.80

Tested by

no test coverage detected