Replace self defined const StatusTooManyRequests with http.StatusTooManyRequests.

This commit is contained in:
Jianfei Bai
2019-08-11 21:05:49 +08:00
parent 46e58df837
commit 07077a8aa5
2 changed files with 5 additions and 2 deletions

View File

@@ -17,6 +17,7 @@ limitations under the License.
package eventratelimit
import (
"net/http"
"testing"
"time"
@@ -516,7 +517,7 @@ func TestEventRateLimiting(t *testing.T) {
}
if err != nil {
statusErr, ok := err.(*errors.StatusError)
if ok && statusErr.ErrStatus.Code != errors.StatusTooManyRequests {
if ok && statusErr.ErrStatus.Code != http.StatusTooManyRequests {
t.Fatalf("%v: Request %v should yield a 429 response: %v", tc.name, rqIndex, err)
}
}