Browse code

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>

Aditi Rajagopal authored on 2015/11/19 10:15:38
Showing 1 changed files
... ...
@@ -2,8 +2,8 @@ package main
2 2
 
3 3
 import (
4 4
 	"net/http"
5
-	"strings"
6 5
 
6
+	"github.com/docker/docker/pkg/integration/checker"
7 7
 	"github.com/go-check/check"
8 8
 )
9 9
 
... ...
@@ -11,8 +11,8 @@ func (s *DockerSuite) TestInfoApi(c *check.C) {
11 11
 	endpoint := "/info"
12 12
 
13 13
 	status, body, err := sockRequest("GET", endpoint, nil)
14
-	c.Assert(status, check.Equals, http.StatusOK)
15
-	c.Assert(err, check.IsNil)
14
+	c.Assert(status, checker.Equals, http.StatusOK)
15
+	c.Assert(err, checker.IsNil)
16 16
 
17 17
 	// always shown fields
18 18
 	stringsToCheck := []string{
... ...
@@ -32,8 +32,6 @@ func (s *DockerSuite) TestInfoApi(c *check.C) {
32 32
 
33 33
 	out := string(body)
34 34
 	for _, linePrefix := range stringsToCheck {
35
-		if !strings.Contains(out, linePrefix) {
36
-			c.Errorf("couldn't find string %v in output", linePrefix)
37
-		}
35
+		c.Assert(out, checker.Contains, linePrefix)
38 36
 	}
39 37
 }