MCPcopy Create free account
hub / github.com/imgproxy/imgproxy / TestIntoSuccess

Method TestIntoSuccess

server/server_test.go:191–205  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

189}
190
191func (s *ServerTestSuite) TestIntoSuccess() {
192 mockHandler := func(reqID string, rw server.ResponseWriter, r *http.Request) *server.Error {
193 rw.WriteHeader(http.StatusOK)
194 return nil
195 }
196
197 s.router().GET("/test", s.router().WithReportError(mockHandler))
198
199 req := httptest.NewRequest(http.MethodGet, "/test", nil)
200 rw := httptest.NewRecorder()
201
202 s.router().ServeHTTP(rw, req)
203
204 s.Equal(http.StatusOK, rw.Code)
205}
206
207func (s *ServerTestSuite) TestIntoWithError() {
208 testError := errctx.NewTextError("test error", 0)

Callers

nothing calls this directly

Calls 5

WriteHeaderMethod · 0.80
WithReportErrorMethod · 0.80
NewRequestMethod · 0.80
ServeHTTPMethod · 0.80
GETMethod · 0.45

Tested by

no test coverage detected