Files
virtual-kubelet/providers/vic/operations/pod_starter_test.go
Brian Goff 947b530f1e 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
2019-03-28 17:08:12 -07:00

34 lines
926 B
Go

package operations
import (
"testing"
"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) {
var s PodStarter
var err error
client := client.Default
ip := &mocks.IsolationProxy{}
// Positive Cases
s, err = NewPodStarter(client, ip)
assert.Check(t, s != nil, "Expected non-nil creating a pod starter but received nil")
// Negative Cases
s, err = NewPodStarter(nil, ip)
assert.Check(t, is.Nil(s), "Expected nil")
assert.Check(t, is.DeepEqual(err, PodStarterPortlayerClientError))
s, err = NewPodStarter(client, nil)
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.