Replace testify with gotest.tools (#553)

* vendor gotest.tools

* Run gotest.tools migration tools

* Fixup tests that were improperly converted

* Remove unused testify package vendors
This commit is contained in:
Brian Goff
2019-03-28 17:08:12 -07:00
committed by GitHub
parent 561ccca561
commit 947b530f1e
20 changed files with 484 additions and 2089 deletions

View File

@@ -3,10 +3,10 @@ package operations
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/virtual-kubelet/virtual-kubelet/providers/vic/proxy/mocks"
"github.com/vmware/vic/lib/apiservers/portlayer/client"
"gotest.tools/assert"
is "gotest.tools/assert/cmp"
)
func TestNewPodStarter(t *testing.T) {
@@ -18,16 +18,16 @@ func TestNewPodStarter(t *testing.T) {
// Positive Cases
s, err = NewPodStarter(client, ip)
assert.NotNil(t, s, "Expected non-nil creating a pod starter but received nil")
assert.Check(t, s != nil, "Expected non-nil creating a pod starter but received nil")
// Negative Cases
s, err = NewPodStarter(nil, ip)
assert.Nil(t, s, "Expected nil")
assert.Equal(t, err, PodStarterPortlayerClientError)
assert.Check(t, is.Nil(s), "Expected nil")
assert.Check(t, is.DeepEqual(err, PodStarterPortlayerClientError))
s, err = NewPodStarter(client, nil)
assert.Nil(t, s, "Expected nil")
assert.Equal(t, err, PodStarterIsolationProxyError)
assert.Check(t, is.Nil(s), "Expected nil")
assert.Check(t, is.DeepEqual(err, PodStarterIsolationProxyError))
}
//NOTE: The rest of PodStarter tests were handled in PodCreator's tests so there's no need for further tests.