From dd9d28669fca5303cf7cf0f72a47d6797f524c72 Mon Sep 17 00:00:00 2001 From: Tibor Vass Date: Mon, 9 Sep 2019 21:05:57 +0000 Subject: [PATCH] rm-gocheck: DeepEquals -> assert.DeepEqual sed -E -i 's#\bassert\.Assert\(c, (.*), checker\.DeepEquals, (.*)#assert.DeepEqual(c, \1, \2#g' \ -- "integration-cli/docker_cli_daemon_test.go" "pkg/discovery/discovery_test.go" "pkg/discovery/file/file_test.go" "pkg/discovery/kv/kv_test.go" "pkg/discovery/memory/memory_test.go" Signed-off-by: Tibor Vass --- integration-cli/docker_cli_daemon_test.go | 2 +- pkg/discovery/discovery_test.go | 2 +- pkg/discovery/file/file_test.go | 4 ++-- pkg/discovery/kv/kv_test.go | 4 ++-- pkg/discovery/memory/memory_test.go | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/integration-cli/docker_cli_daemon_test.go b/integration-cli/docker_cli_daemon_test.go index 00318beb84..56d452ac41 100644 --- a/integration-cli/docker_cli_daemon_test.go +++ b/integration-cli/docker_cli_daemon_test.go @@ -1727,7 +1727,7 @@ func (s *DockerDaemonSuite) TestDaemonStartWithDefaultTLSHost(c *testing.T) { assert.Assert(c, certRequestInfo, checker.NotNil) assert.Assert(c, certRequestInfo.AcceptableCAs, checker.HasLen, 1) - assert.Assert(c, certRequestInfo.AcceptableCAs[0], checker.DeepEquals, rootCert.RawSubject) + assert.DeepEqual(c, certRequestInfo.AcceptableCAs[0], rootCert.RawSubject) } func (s *DockerDaemonSuite) TestBridgeIPIsExcludedFromAllocatorPool(c *testing.T) { diff --git a/pkg/discovery/discovery_test.go b/pkg/discovery/discovery_test.go index 94622a94d1..1f8557b230 100644 --- a/pkg/discovery/discovery_test.go +++ b/pkg/discovery/discovery_test.go @@ -52,7 +52,7 @@ func (s *DiscoverySuite) TestParse(c *testing.T) { func (s *DiscoverySuite) TestCreateEntries(c *testing.T) { entries, err := CreateEntries(nil) - assert.Assert(c, entries, checker.DeepEquals, Entries{}) + assert.DeepEqual(c, entries, Entries{}) assert.Assert(c, err, checker.IsNil) entries, err = CreateEntries([]string{"127.0.0.1:2375", "127.0.0.2:2375", "[2001:db8:0:f101::2]:2375", ""}) diff --git a/pkg/discovery/file/file_test.go b/pkg/discovery/file/file_test.go index 0f4de2b5c9..d27f235066 100644 --- a/pkg/discovery/file/file_test.go +++ b/pkg/discovery/file/file_test.go @@ -95,7 +95,7 @@ func (s *DiscoverySuite) TestWatch(c *testing.T) { // Write the file and make sure we get the expected value back. assert.Assert(c, ioutil.WriteFile(tmp.Name(), []byte(data), 0600), checker.IsNil) - assert.Assert(c, <-ch, checker.DeepEquals, expected) + assert.DeepEqual(c, <-ch, expected) // Add a new entry and look it up. expected = append(expected, &discovery.Entry{Host: "3.3.3.3", Port: "3333"}) @@ -105,7 +105,7 @@ func (s *DiscoverySuite) TestWatch(c *testing.T) { _, err = f.WriteString("\n3.3.3.3:3333\n") assert.Assert(c, err, checker.IsNil) f.Close() - assert.Assert(c, <-ch, checker.DeepEquals, expected) + assert.DeepEqual(c, <-ch, expected) // Stop and make sure it closes all channels. close(stopCh) diff --git a/pkg/discovery/kv/kv_test.go b/pkg/discovery/kv/kv_test.go index 56cc8c5a08..1e3b36dfad 100644 --- a/pkg/discovery/kv/kv_test.go +++ b/pkg/discovery/kv/kv_test.go @@ -239,13 +239,13 @@ func (ds *DiscoverySuite) TestWatch(c *testing.T) { // Push the entries into the store channel and make sure discovery emits. mockCh <- kvs - assert.Assert(c, <-ch, checker.DeepEquals, expected) + assert.DeepEqual(c, <-ch, expected) // Add a new entry. expected = append(expected, &discovery.Entry{Host: "3.3.3.3", Port: "3333"}) kvs = append(kvs, &store.KVPair{Key: path.Join("path", defaultDiscoveryPath, "3.3.3.3"), Value: []byte("3.3.3.3:3333")}) mockCh <- kvs - assert.Assert(c, <-ch, checker.DeepEquals, expected) + assert.DeepEqual(c, <-ch, expected) close(mockCh) // Give it enough time to call WatchTree. diff --git a/pkg/discovery/memory/memory_test.go b/pkg/discovery/memory/memory_test.go index 6545f0bc4e..1cc829a8cc 100644 --- a/pkg/discovery/memory/memory_test.go +++ b/pkg/discovery/memory/memory_test.go @@ -31,7 +31,7 @@ func (s *discoverySuite) TestWatch(c *testing.T) { } assert.Assert(c, d.Register("1.1.1.1:1111"), checker.IsNil) - assert.Assert(c, <-ch, checker.DeepEquals, expected) + assert.DeepEqual(c, <-ch, expected) expected = discovery.Entries{ &discovery.Entry{Host: "1.1.1.1", Port: "1111"}, @@ -39,7 +39,7 @@ func (s *discoverySuite) TestWatch(c *testing.T) { } assert.Assert(c, d.Register("2.2.2.2:2222"), checker.IsNil) - assert.Assert(c, <-ch, checker.DeepEquals, expected) + assert.DeepEqual(c, <-ch, expected) // Stop and make sure it closes all channels. close(stopCh)