1
0
Fork 0

Use contants from http package.

This commit is contained in:
Ludovic Fernandez 2017-11-20 09:40:03 +01:00 committed by Traefiker
parent 7ed4ae2f8c
commit 05a9350e57
16 changed files with 68 additions and 62 deletions

View file

@ -365,7 +365,7 @@ func (s *WebsocketSuite) TestBasicAuth(c *check.C) {
func (s *WebsocketSuite) TestSpecificResponseFromBackend(c *check.C) {
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(401)
w.WriteHeader(http.StatusUnauthorized)
}))
file := s.adaptFile(c, "fixtures/websocket/config.toml", struct {
WebsocketServer string
@ -387,7 +387,7 @@ func (s *WebsocketSuite) TestSpecificResponseFromBackend(c *check.C) {
_, resp, err := gorillawebsocket.DefaultDialer.Dial("ws://127.0.0.1:8000/ws", nil)
c.Assert(err, checker.NotNil)
c.Assert(resp.StatusCode, check.Equals, 401)
c.Assert(resp.StatusCode, check.Equals, http.StatusUnauthorized)
}