github.com/unionj-cloud/go-doudou@v1.3.8-0.20221011095552-0088008e5b31/cmd/shutdown_test.go (about) 1 package cmd_test 2 3 import ( 4 "github.com/stretchr/testify/assert" 5 "github.com/unionj-cloud/go-doudou/cmd" 6 "os" 7 "path/filepath" 8 "testing" 9 ) 10 11 func TestShutdownCmd(t *testing.T) { 12 dir := filepath.Join(testDir, "testsvc") 13 err := os.Chdir(dir) 14 if err != nil { 15 t.Fatal(err) 16 } 17 assert.Panics(t, func() { 18 ExecuteCommandC(cmd.GetRootCmd(), []string{"svc", "shutdown"}...) 19 }) 20 }