mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
[nit] integration-cli: obey Go's naming convention
No substantial code change. - Api --> API - Cli --> CLI - Http, Https --> HTTP, HTTPS - Id --> ID - Uid,Gid,Pid --> UID,PID,PID - Ipam --> IPAM - Tls --> TLS (TestDaemonNoTlsCliTlsVerifyWithEnv --> TestDaemonTLSVerifyIssue13964) Didn't touch in this commit: - Git: because it is officially "Git": https://git-scm.com/ - Tar: because it is officially "Tar": https://www.gnu.org/software/tar/ - Cpu, Nat, Mac, Ipc, Shm: for keeping a consistency with existing production code (not changable, for compatibility) Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
This commit is contained in:
@@ -15,13 +15,13 @@ import (
|
||||
"github.com/go-check/check"
|
||||
)
|
||||
|
||||
func (s *DockerSuite) TestApiOptionsRoute(c *check.C) {
|
||||
func (s *DockerSuite) TestAPIOptionsRoute(c *check.C) {
|
||||
status, _, err := sockRequest("OPTIONS", "/", nil)
|
||||
c.Assert(err, checker.IsNil)
|
||||
c.Assert(status, checker.Equals, http.StatusOK)
|
||||
}
|
||||
|
||||
func (s *DockerSuite) TestApiGetEnabledCors(c *check.C) {
|
||||
func (s *DockerSuite) TestAPIGetEnabledCORS(c *check.C) {
|
||||
res, body, err := sockRequestRaw("GET", "/version", nil, "")
|
||||
c.Assert(err, checker.IsNil)
|
||||
c.Assert(res.StatusCode, checker.Equals, http.StatusOK)
|
||||
@@ -33,7 +33,7 @@ func (s *DockerSuite) TestApiGetEnabledCors(c *check.C) {
|
||||
//c.Assert(res.Header.Get("Access-Control-Allow-Headers"), check.Equals, "Origin, X-Requested-With, Content-Type, Accept, X-Registry-Auth")
|
||||
}
|
||||
|
||||
func (s *DockerSuite) TestApiVersionStatusCode(c *check.C) {
|
||||
func (s *DockerSuite) TestAPIVersionStatusCode(c *check.C) {
|
||||
conn, err := sockConn(time.Duration(10*time.Second), "")
|
||||
c.Assert(err, checker.IsNil)
|
||||
|
||||
@@ -48,7 +48,7 @@ func (s *DockerSuite) TestApiVersionStatusCode(c *check.C) {
|
||||
c.Assert(res.StatusCode, checker.Equals, http.StatusBadRequest)
|
||||
}
|
||||
|
||||
func (s *DockerSuite) TestApiClientVersionNewerThanServer(c *check.C) {
|
||||
func (s *DockerSuite) TestAPIClientVersionNewerThanServer(c *check.C) {
|
||||
v := strings.Split(api.DefaultVersion, ".")
|
||||
vMinInt, err := strconv.Atoi(v[1])
|
||||
c.Assert(err, checker.IsNil)
|
||||
@@ -63,7 +63,7 @@ func (s *DockerSuite) TestApiClientVersionNewerThanServer(c *check.C) {
|
||||
c.Assert(getErrorMessage(c, body), checker.Equals, expected)
|
||||
}
|
||||
|
||||
func (s *DockerSuite) TestApiClientVersionOldNotSupported(c *check.C) {
|
||||
func (s *DockerSuite) TestAPIClientVersionOldNotSupported(c *check.C) {
|
||||
v := strings.Split(api.MinVersion, ".")
|
||||
vMinInt, err := strconv.Atoi(v[1])
|
||||
c.Assert(err, checker.IsNil)
|
||||
@@ -78,7 +78,7 @@ func (s *DockerSuite) TestApiClientVersionOldNotSupported(c *check.C) {
|
||||
c.Assert(strings.TrimSpace(string(body)), checker.Equals, expected)
|
||||
}
|
||||
|
||||
func (s *DockerSuite) TestApiDockerApiVersion(c *check.C) {
|
||||
func (s *DockerSuite) TestAPIDockerAPIVersion(c *check.C) {
|
||||
var svrVersion string
|
||||
|
||||
server := httptest.NewServer(http.HandlerFunc(
|
||||
@@ -97,7 +97,7 @@ func (s *DockerSuite) TestApiDockerApiVersion(c *check.C) {
|
||||
c.Assert(svrVersion, check.Equals, "/vxxx/version", check.Commentf("%s", result.Compare(icmd.Success)))
|
||||
}
|
||||
|
||||
func (s *DockerSuite) TestApiErrorJSON(c *check.C) {
|
||||
func (s *DockerSuite) TestAPIErrorJSON(c *check.C) {
|
||||
httpResp, body, err := sockRequestRaw("POST", "/containers/create", strings.NewReader(`{}`), "application/json")
|
||||
c.Assert(err, checker.IsNil)
|
||||
c.Assert(httpResp.StatusCode, checker.Equals, http.StatusInternalServerError)
|
||||
@@ -107,7 +107,7 @@ func (s *DockerSuite) TestApiErrorJSON(c *check.C) {
|
||||
c.Assert(getErrorMessage(c, b), checker.Equals, "Config cannot be empty in order to create a container")
|
||||
}
|
||||
|
||||
func (s *DockerSuite) TestApiErrorPlainText(c *check.C) {
|
||||
func (s *DockerSuite) TestAPIErrorPlainText(c *check.C) {
|
||||
httpResp, body, err := sockRequestRaw("POST", "/v1.23/containers/create", strings.NewReader(`{}`), "application/json")
|
||||
c.Assert(err, checker.IsNil)
|
||||
c.Assert(httpResp.StatusCode, checker.Equals, http.StatusInternalServerError)
|
||||
@@ -117,7 +117,7 @@ func (s *DockerSuite) TestApiErrorPlainText(c *check.C) {
|
||||
c.Assert(strings.TrimSpace(string(b)), checker.Equals, "Config cannot be empty in order to create a container")
|
||||
}
|
||||
|
||||
func (s *DockerSuite) TestApiErrorNotFoundJSON(c *check.C) {
|
||||
func (s *DockerSuite) TestAPIErrorNotFoundJSON(c *check.C) {
|
||||
// 404 is a different code path to normal errors, so test separately
|
||||
httpResp, body, err := sockRequestRaw("GET", "/notfound", nil, "application/json")
|
||||
c.Assert(err, checker.IsNil)
|
||||
@@ -128,7 +128,7 @@ func (s *DockerSuite) TestApiErrorNotFoundJSON(c *check.C) {
|
||||
c.Assert(getErrorMessage(c, b), checker.Equals, "page not found")
|
||||
}
|
||||
|
||||
func (s *DockerSuite) TestApiErrorNotFoundPlainText(c *check.C) {
|
||||
func (s *DockerSuite) TestAPIErrorNotFoundPlainText(c *check.C) {
|
||||
httpResp, body, err := sockRequestRaw("GET", "/v1.23/notfound", nil, "application/json")
|
||||
c.Assert(err, checker.IsNil)
|
||||
c.Assert(httpResp.StatusCode, checker.Equals, http.StatusNotFound)
|
||||
|
||||
Reference in New Issue
Block a user