MCPcopy Index your code
hub / github.com/perkeep/perkeep / TestConfig

Function TestConfig

pkg/blobserver/proxycache/proxycache_test.go:130–153  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

128}
129
130func TestConfig(t *testing.T) {
131 const maxBytes = 1 << 5
132 px, ds := NewProxiedDisk(t)
133
134 ld := test.NewLoader()
135 ld.SetStorage("origin", ds)
136 ld.SetStorage("cache", px)
137
138 cache, err := newFromConfig(ld, jsonconfig.Obj{
139 "origin": "origin",
140 "cache": "cache",
141 "maxCacheBytes": float64(maxBytes),
142 })
143
144 if err != nil {
145 t.Fatal(err)
146 }
147
148 sto := cache.(*Storage)
149 if sto.maxCacheBytes != maxBytes {
150 t.Fatalf("incorrectly read maxCacheBytes. saw: %d expected: %d",
151 sto.maxCacheBytes, maxBytes)
152 }
153}

Callers

nothing calls this directly

Calls 6

SetStorageMethod · 0.95
NewLoaderFunction · 0.92
NewProxiedDiskFunction · 0.85
FatalMethod · 0.80
newFromConfigFunction · 0.70
FatalfMethod · 0.65

Tested by

no test coverage detected