MCPcopy Create free account
hub / github.com/Azure/peerd / TestGetKey

Function TestGetKey

pkg/cache/filecache_test.go:25–34  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

23)
24
25func TestGetKey(t *testing.T) {
26 name := newRandomStringN(10)
27 offset := int64(100)
28 c := NewCache(context.Background(), cacheBlockSize, testFileCachePath)
29 got := c.(*fileCache).getKey(name, offset)
30 want := fmt.Sprintf("%v/%v/%v", testFileCachePath, name, offset)
31 if got != want {
32 t.Errorf("expected: %v, got: %v", want, got)
33 }
34}
35
36func TestExists(t *testing.T) {
37 c := NewCache(context.Background(), cacheBlockSize, testFileCachePath)

Callers

nothing calls this directly

Calls 3

NewCacheFunction · 0.85
getKeyMethod · 0.80
newRandomStringNFunction · 0.70

Tested by

no test coverage detected