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

Function TestCacheResizeHandler

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

Source from the content-addressed store, hash-verified

202}
203
204func TestCacheResizeHandler(t *testing.T) {
205 log.SetOutput(ioutil.Discard)
206 srv := testServer()
207 srv.profile = true
208 s := httptest.NewServer(srv.Handler())
209 _, got, err := httpPost(s.URL+"/debug/cache/resize", "10")
210 if err != nil {
211 t.Fatal(err)
212 }
213 want := "{\n \"message\": \"Changed cache capacity to 10.\"\n}"
214 if got != want {
215 t.Errorf("got %q, want %q", got, want)
216 }
217}
218
219func TestIPv4FromRequest(t *testing.T) {
220 var tests = []ipTestCase{

Callers

nothing calls this directly

Calls 3

testServerFunction · 0.85
httpPostFunction · 0.85
HandlerMethod · 0.45

Tested by

no test coverage detected