exec_test.go 585 B

123456789101112131415161718192021222324252627282930
  1. package mobycli
  2. import (
  3. "testing"
  4. "gotest.tools/v3/assert"
  5. "github.com/docker/api/context/store"
  6. )
  7. func TestDelegateContextTypeToMoby(t *testing.T) {
  8. isDelegated := func(val string) bool {
  9. for _, ctx := range delegatedContextTypes {
  10. if ctx == val {
  11. return true
  12. }
  13. }
  14. return false
  15. }
  16. allCtx := []string{store.AciContextType, store.EcsContextType, store.AwsContextType, store.DefaultContextType}
  17. for _, ctx := range allCtx {
  18. if isDelegated(ctx) {
  19. assert.Assert(t, mustDelegateToMoby(ctx))
  20. continue
  21. }
  22. assert.Assert(t, !mustDelegateToMoby(ctx))
  23. }
  24. }