github.com/ali-iotechsys/cli@v20.10.0+incompatible/e2e/context/context_test.go (about)

     1  package context
     2  
     3  import (
     4  	"testing"
     5  
     6  	"gotest.tools/v3/golden"
     7  	"gotest.tools/v3/icmd"
     8  )
     9  
    10  func TestContextList(t *testing.T) {
    11  	cmd := icmd.Command("docker", "context", "ls")
    12  	cmd.Env = append(cmd.Env,
    13  		"DOCKER_CONFIG=./testdata/test-dockerconfig",
    14  		"KUBECONFIG=./testdata/test-kubeconfig",
    15  	)
    16  	result := icmd.RunCmd(cmd).Assert(t, icmd.Expected{
    17  		Err:      icmd.None,
    18  		ExitCode: 0,
    19  	})
    20  	golden.Assert(t, result.Stdout(), "context-ls.golden")
    21  }