MCPcopy Index your code
hub / github.com/labstack/echo / TestGroupFile

Function TestGroupFile

group_test.go:73–84  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

71}
72
73func TestGroupFile(t *testing.T) {
74 e := New()
75 g := e.Group("/group")
76 g.File("/walle", "_fixture/images/walle.png")
77 expectedData, err := os.ReadFile("_fixture/images/walle.png")
78 assert.Nil(t, err)
79 req := httptest.NewRequest(http.MethodGet, "/group/walle", nil)
80 rec := httptest.NewRecorder()
81 e.ServeHTTP(rec, req)
82 assert.Equal(t, http.StatusOK, rec.Code)
83 assert.Equal(t, expectedData, rec.Body.Bytes())
84}
85
86func TestGroupRouteMiddleware(t *testing.T) {
87 // Ensure middleware slices are not re-used

Callers

nothing calls this directly

Calls 4

NewFunction · 0.85
ServeHTTPMethod · 0.80
GroupMethod · 0.45
FileMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…