1
0
mirror of https://github.com/docker/compose-cli.git synced 2026-10-25 06:19:18 +03:00
Files
compose-cli/cli/mobycli/exec_test.go
2020-07-30 11:40:44 +02:00

42 lines
819 B
Go

package mobycli
import (
"testing"
. "github.com/onsi/gomega"
"github.com/stretchr/testify/suite"
"github.com/docker/api/context/store"
"github.com/docker/api/tests/framework"
)
type MobyExecSuite struct {
framework.CliSuite
}
func (sut *MobyExecSuite) TestDelegateContextTypeToMoby() {
isDelegated := func(val string) bool {
for _, ctx := range delegatedContextTypes {
if ctx == val {
return true
}
}
return false
}
allCtx := []string{store.AciContextType, store.EcsContextType, store.AwsContextType, store.DefaultContextType}
for _, ctx := range allCtx {
if isDelegated(ctx) {
Expect(mustDelegateToMoby(ctx)).To(BeTrue())
continue
}
Expect(mustDelegateToMoby(ctx)).To(BeFalse())
}
}
func TestExec(t *testing.T) {
RegisterTestingT(t)
suite.Run(t, new(MobyExecSuite))
}