Use http constants instead of string (#5908)

Signed-off-by: Fish-pro <zechun.chen@daocloud.io>
This commit is contained in:
Fish-pro
2023-02-09 19:29:49 +08:00
committed by GitHub
parent 055b2c31a9
commit 039a4d87e2
4 changed files with 7 additions and 7 deletions

View File

@@ -32,7 +32,7 @@ func TestReady(t *testing.T) {
if err != nil {
t.Fatalf("Unable to query %s: %v", address, err)
}
if response.StatusCode != 503 {
if response.StatusCode != http.StatusServiceUnavailable {
t.Errorf("Invalid status code: expecting %d, got %d", 503, response.StatusCode)
}
response.Body.Close()
@@ -48,7 +48,7 @@ func TestReady(t *testing.T) {
if err != nil {
t.Fatalf("Unable to query %s: %v", address, err)
}
if response.StatusCode != 200 {
if response.StatusCode != http.StatusOK {
t.Errorf("Invalid status code: expecting %d, got %d", 200, response.StatusCode)
}
response.Body.Close()
@@ -62,7 +62,7 @@ func TestReady(t *testing.T) {
if err != nil {
t.Fatalf("Unable to query %s: %v", address, err)
}
if response.StatusCode != 200 {
if response.StatusCode != http.StatusOK {
t.Errorf("Invalid status code: expecting %d, got %d", 200, response.StatusCode)
}
response.Body.Close()