MCPcopy Create free account
hub / github.com/dinofizz/diskplayer / TestIndexHandler

Function TestIndexHandler

server_test.go:44–59  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

42}
43
44func TestIndexHandler(t *testing.T) {
45 req, err := http.NewRequest("GET", "/", nil)
46 if err != nil {
47 t.Fatal(err)
48 }
49
50 rr := httptest.NewRecorder()
51 handler := http.HandlerFunc(indexHandler)
52
53 handler.ServeHTTP(rr, req)
54
55 if status := rr.Code; status != http.StatusOK {
56 t.Errorf("handler returned wrong status code: got %v want %v",
57 status, http.StatusOK)
58 }
59}

Callers

nothing calls this directly

Calls 1

ServeHTTPMethod · 0.80

Tested by

no test coverage detected