*: Replace internal testutil AssertEqual function in favour of github.com/stretchr/testify/assert.Equals

To maintain uniformity in testing methodology, assert.Equals has been used everywhere while replacing testutil.AssertEqual

Fixes #13015
This commit is contained in:
Pavan BG
2021-05-20 19:55:45 +05:30
parent b29e8e47a6
commit d9c5e1f0a2
14 changed files with 320 additions and 303 deletions

View File

@ -24,8 +24,8 @@ import (
"testing"
"time"
"github.com/stretchr/testify/assert"
"go.etcd.io/etcd/client/pkg/v3/srv"
"go.etcd.io/etcd/client/pkg/v3/testutil"
"go.etcd.io/etcd/client/pkg/v3/transport"
"go.etcd.io/etcd/client/pkg/v3/types"
@ -80,11 +80,11 @@ func TestConfigFileOtherFields(t *testing.T) {
t.Errorf("PeerTLS = %v, want %v", cfg.PeerTLSInfo, ptls)
}
testutil.AssertEqual(t, true, cfg.ForceNewCluster, "ForceNewCluster does not match")
assert.Equal(t, true, cfg.ForceNewCluster, "ForceNewCluster does not match")
testutil.AssertEqual(t, true, cfg.SocketOpts.ReusePort, "ReusePort does not match")
assert.Equal(t, true, cfg.SocketOpts.ReusePort, "ReusePort does not match")
testutil.AssertEqual(t, false, cfg.SocketOpts.ReuseAddress, "ReuseAddress does not match")
assert.Equal(t, false, cfg.SocketOpts.ReuseAddress, "ReuseAddress does not match")
}
// TestUpdateDefaultClusterFromName ensures that etcd can start with 'etcd --name=abc'.