exec_test.go 819 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package mobycli
  2. import (
  3. "testing"
  4. . "github.com/onsi/gomega"
  5. "github.com/stretchr/testify/suite"
  6. "github.com/docker/api/context/store"
  7. "github.com/docker/api/tests/framework"
  8. )
  9. type MobyExecSuite struct {
  10. framework.CliSuite
  11. }
  12. func (sut *MobyExecSuite) TestDelegateContextTypeToMoby() {
  13. isDelegated := func(val string) bool {
  14. for _, ctx := range delegatedContextTypes {
  15. if ctx == val {
  16. return true
  17. }
  18. }
  19. return false
  20. }
  21. allCtx := []string{store.AciContextType, store.EcsContextType, store.AwsContextType, store.DefaultContextType}
  22. for _, ctx := range allCtx {
  23. if isDelegated(ctx) {
  24. Expect(mustDelegateToMoby(ctx)).To(BeTrue())
  25. continue
  26. }
  27. Expect(mustDelegateToMoby(ctx)).To(BeFalse())
  28. }
  29. }
  30. func TestExec(t *testing.T) {
  31. RegisterTestingT(t)
  32. suite.Run(t, new(MobyExecSuite))
  33. }