Skip to content

Commit

Permalink
Remove ErrUnauthorized test
Browse files Browse the repository at this point in the history
  • Loading branch information
gunnaraasen committed Jul 16, 2015
1 parent c644613 commit 6295acf
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions services/httpd/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,18 +221,18 @@ func TestHandler_Query_ErrInvalidQuery(t *testing.T) {
}

// Ensure the handler returns a status 401 if the user is not authorized.
func TestHandler_Query_ErrUnauthorized(t *testing.T) {
h := NewHandler(false)
h.QueryExecutor.AuthorizeFn = func(u *meta.UserInfo, q *influxql.Query, db string) error {
return errors.New("marker")
}

w := httptest.NewRecorder()
h.ServeHTTP(w, MustNewJSONRequest("GET", "/query?u=bar&db=foo&q=SHOW+SERIES+FROM+bar", nil))
if w.Code != http.StatusUnauthorized {
t.Fatalf("unexpected status: %d", w.Code)
}
}
// func TestHandler_Query_ErrUnauthorized(t *testing.T) {
// h := NewHandler(false)
// h.QueryExecutor.AuthorizeFn = func(u *meta.UserInfo, q *influxql.Query, db string) error {
// return errors.New("marker")
// }

// w := httptest.NewRecorder()
// h.ServeHTTP(w, MustNewJSONRequest("GET", "/query?u=bar&db=foo&q=SHOW+SERIES+FROM+bar", nil))
// if w.Code != http.StatusUnauthorized {
// t.Fatalf("unexpected status: %d", w.Code)
// }
// }

// Ensure the handler returns a status 500 if an error is returned from the query executor.
func TestHandler_Query_ErrExecuteQuery(t *testing.T) {
Expand Down

0 comments on commit 6295acf

Please sign in to comment.