mirror of https://github.com/docker/docs.git
fix test case name
Name like this will never run by go test. And this test case won't get PAAS. Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
This commit is contained in:
parent
cc43263f8c
commit
a8d2fbe7b4
|
@ -13,19 +13,20 @@ import (
|
||||||
"github.com/docker/docker/pkg/version"
|
"github.com/docker/docker/pkg/version"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TesthttpError(t *testing.T) {
|
func TestHttpError(t *testing.T) {
|
||||||
r := httptest.NewRecorder()
|
r := httptest.NewRecorder()
|
||||||
|
|
||||||
httpError(r, fmt.Errorf("No such method"))
|
httpError(r, fmt.Errorf("No such method"))
|
||||||
if r.Code != http.StatusNotFound {
|
if r.Code != http.StatusNotFound {
|
||||||
t.Fatalf("Expected %d, got %d", http.StatusNotFound, r.Code)
|
t.Fatalf("Expected %d, got %d", http.StatusNotFound, r.Code)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
r = httptest.NewRecorder()
|
||||||
httpError(r, fmt.Errorf("This accound hasn't been activated"))
|
httpError(r, fmt.Errorf("This accound hasn't been activated"))
|
||||||
if r.Code != http.StatusForbidden {
|
if r.Code != http.StatusForbidden {
|
||||||
t.Fatalf("Expected %d, got %d", http.StatusForbidden, r.Code)
|
t.Fatalf("Expected %d, got %d", http.StatusForbidden, r.Code)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
r = httptest.NewRecorder()
|
||||||
httpError(r, fmt.Errorf("Some error"))
|
httpError(r, fmt.Errorf("Some error"))
|
||||||
if r.Code != http.StatusInternalServerError {
|
if r.Code != http.StatusInternalServerError {
|
||||||
t.Fatalf("Expected %d, got %d", http.StatusInternalServerError, r.Code)
|
t.Fatalf("Expected %d, got %d", http.StatusInternalServerError, r.Code)
|
||||||
|
|
Loading…
Reference in New Issue