1
0
mirror of https://github.com/labstack/echo.git synced 2025-07-03 00:56:59 +02:00

Replace http constants with stdlib ones, i.e.: http.MethodGet instead of echo.GET (#1205)

This commit is contained in:
Emir Ribić
2018-10-14 17:16:58 +02:00
committed by Vishal Rana
parent 059c099762
commit c8fd197fa8
33 changed files with 270 additions and 271 deletions

View File

@ -14,7 +14,7 @@ import (
func TestGzip(t *testing.T) {
e := echo.New()
req := httptest.NewRequest(echo.GET, "/", nil)
req := httptest.NewRequest(http.MethodGet, "/", nil)
rec := httptest.NewRecorder()
c := e.NewContext(req, rec)
@ -30,7 +30,7 @@ func TestGzip(t *testing.T) {
assert.Equal("test", rec.Body.String())
// Gzip
req = httptest.NewRequest(echo.GET, "/", nil)
req = httptest.NewRequest(http.MethodGet, "/", nil)
req.Header.Set(echo.HeaderAcceptEncoding, gzipScheme)
rec = httptest.NewRecorder()
c = e.NewContext(req, rec)
@ -48,7 +48,7 @@ func TestGzip(t *testing.T) {
func TestGzipNoContent(t *testing.T) {
e := echo.New()
req := httptest.NewRequest(echo.GET, "/", nil)
req := httptest.NewRequest(http.MethodGet, "/", nil)
req.Header.Set(echo.HeaderAcceptEncoding, gzipScheme)
rec := httptest.NewRecorder()
c := e.NewContext(req, rec)
@ -68,7 +68,7 @@ func TestGzipErrorReturned(t *testing.T) {
e.GET("/", func(c echo.Context) error {
return echo.ErrNotFound
})
req := httptest.NewRequest(echo.GET, "/", nil)
req := httptest.NewRequest(http.MethodGet, "/", nil)
req.Header.Set(echo.HeaderAcceptEncoding, gzipScheme)
rec := httptest.NewRecorder()
e.ServeHTTP(rec, req)
@ -81,7 +81,7 @@ func TestGzipWithStatic(t *testing.T) {
e := echo.New()
e.Use(Gzip())
e.Static("/test", "../_fixture/images")
req := httptest.NewRequest(echo.GET, "/test/walle.png", nil)
req := httptest.NewRequest(http.MethodGet, "/test/walle.png", nil)
req.Header.Set(echo.HeaderAcceptEncoding, gzipScheme)
rec := httptest.NewRecorder()
e.ServeHTTP(rec, req)