зеркало из https://github.com/microsoft/docker.git
Checkers on integration-cli/docker_api_info_test
Applying #16756 to integration-cli/docker_api_info_test.go Signed-off-by: Aditi Rajagopal <arajagopal@us.ibm.com>
This commit is contained in:
Родитель
3ff9bb5332
Коммит
5cfa13ae48
|
@ -2,8 +2,8 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
|
||||||
|
|
||||||
|
"github.com/docker/docker/pkg/integration/checker"
|
||||||
"github.com/go-check/check"
|
"github.com/go-check/check"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -11,8 +11,8 @@ func (s *DockerSuite) TestInfoApi(c *check.C) {
|
||||||
endpoint := "/info"
|
endpoint := "/info"
|
||||||
|
|
||||||
status, body, err := sockRequest("GET", endpoint, nil)
|
status, body, err := sockRequest("GET", endpoint, nil)
|
||||||
c.Assert(status, check.Equals, http.StatusOK)
|
c.Assert(status, checker.Equals, http.StatusOK)
|
||||||
c.Assert(err, check.IsNil)
|
c.Assert(err, checker.IsNil)
|
||||||
|
|
||||||
// always shown fields
|
// always shown fields
|
||||||
stringsToCheck := []string{
|
stringsToCheck := []string{
|
||||||
|
@ -32,8 +32,6 @@ func (s *DockerSuite) TestInfoApi(c *check.C) {
|
||||||
|
|
||||||
out := string(body)
|
out := string(body)
|
||||||
for _, linePrefix := range stringsToCheck {
|
for _, linePrefix := range stringsToCheck {
|
||||||
if !strings.Contains(out, linePrefix) {
|
c.Assert(out, checker.Contains, linePrefix)
|
||||||
c.Errorf("couldn't find string %v in output", linePrefix)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче