MCPcopy
hub / github.com/perkeep/perkeep / NewTestStorage

Function NewTestStorage

pkg/blobserver/files/enumerate_test.go:38–47  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

36)
37
38func NewTestStorage(t *testing.T) (sto blobserver.Storage, root string) {
39 epochLock.Lock()
40 rootEpoch++
41 path := fmt.Sprintf("%s/camli-testroot-%d-%d", os.TempDir(), os.Getpid(), rootEpoch)
42 epochLock.Unlock()
43 if err := os.MkdirAll(path, 0755); err != nil {
44 t.Fatalf("Failed to create temp directory %q: %v", path, err)
45 }
46 return files.NewStorage(files.OSFS(), path), path
47}
48
49func TestEnumerate(t *testing.T) {
50 ds, root := NewTestStorage(t)

Callers 3

TestEnumerateFunction · 0.85
TestEnumerateEmptyFunction · 0.85
TestEnumerateIsSortedFunction · 0.85

Calls 6

NewStorageFunction · 0.92
OSFSFunction · 0.92
LockMethod · 0.80
UnlockMethod · 0.80
MkdirAllMethod · 0.65
FatalfMethod · 0.65

Tested by

no test coverage detected