MCPcopy Create free account
hub / github.com/mpolden/echoip / TestCacheHandler

Function TestCacheHandler

http/http_test.go:189–202  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

187}
188
189func TestCacheHandler(t *testing.T) {
190 log.SetOutput(ioutil.Discard)
191 srv := testServer()
192 srv.profile = true
193 s := httptest.NewServer(srv.Handler())
194 got, _, err := httpGet(s.URL+"/debug/cache/", jsonMediaType, "")
195 if err != nil {
196 t.Fatal(err)
197 }
198 want := "{\n \"size\": 0,\n \"capacity\": 100,\n \"evictions\": 0\n}"
199 if got != want {
200 t.Errorf("got %q, want %q", got, want)
201 }
202}
203
204func TestCacheResizeHandler(t *testing.T) {
205 log.SetOutput(ioutil.Discard)

Callers

nothing calls this directly

Calls 3

testServerFunction · 0.85
httpGetFunction · 0.85
HandlerMethod · 0.45

Tested by

no test coverage detected