From ee7fdbe8b9ff6ed48d183d2160c4ad5a2d713261 Mon Sep 17 00:00:00 2001 From: Xiaoxu Chen Date: Fri, 9 Oct 2015 17:45:28 +0800 Subject: [PATCH] Use Assert statement to replace condition judgment part of #16756 Signed-off-by: Xiaoxu Chen --- integration-cli/docker_hub_pull_suite_test.go | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/integration-cli/docker_hub_pull_suite_test.go b/integration-cli/docker_hub_pull_suite_test.go index ca438f7ae8..6aa93469f3 100644 --- a/integration-cli/docker_hub_pull_suite_test.go +++ b/integration-cli/docker_hub_pull_suite_test.go @@ -5,6 +5,7 @@ import ( "runtime" "strings" + "github.com/docker/docker/pkg/integration/checker" "github.com/go-check/check" ) @@ -39,17 +40,15 @@ func newDockerHubPullSuite() *DockerHubPullSuite { func (s *DockerHubPullSuite) SetUpSuite(c *check.C) { testRequires(c, DaemonIsLinux) s.d = NewDaemon(c) - if err := s.d.Start(); err != nil { - c.Fatalf("starting push/pull test daemon: %v", err) - } + err := s.d.Start() + c.Assert(err, checker.IsNil, check.Commentf("starting push/pull test daemon: %v", err)) } // TearDownSuite stops the suite daemon. func (s *DockerHubPullSuite) TearDownSuite(c *check.C) { if s.d != nil { - if err := s.d.Stop(); err != nil { - c.Fatalf("stopping push/pull test daemon: %v", err) - } + err := s.d.Stop() + c.Assert(err, checker.IsNil, check.Commentf("stopping push/pull test daemon: %v", err)) } } @@ -71,7 +70,7 @@ func (s *DockerHubPullSuite) TearDownTest(c *check.C) { // output. The function fails the test when the command returns an error. func (s *DockerHubPullSuite) Cmd(c *check.C, name string, arg ...string) string { out, err := s.CmdWithError(name, arg...) - c.Assert(err, check.IsNil, check.Commentf("%q failed with errors: %s, %v", strings.Join(arg, " "), out, err)) + c.Assert(err, checker.IsNil, check.Commentf("%q failed with errors: %s, %v", strings.Join(arg, " "), out, err)) return out }