add test case for container list

Signed-off-by: jason yang <jasonyangshadow@gmail.com>
This commit is contained in:
jason yang
2023-03-29 12:44:12 +00:00
parent 6dcd26322a
commit fd768145a9
4 changed files with 136 additions and 30 deletions

View File

@@ -54,6 +54,7 @@ WW_INTERNAL: 0
baseCmd.SetOut(nil)
baseCmd.SetErr(nil)
stdoutR, stdoutW, _ := os.Pipe()
oriout := os.Stdout
os.Stdout = stdoutW
err = baseCmd.Execute()
if err != nil {
@@ -67,6 +68,7 @@ WW_INTERNAL: 0
stdoutC <- buf.String()
}()
stdoutW.Close()
os.Stdout = oriout
stdout := <-stdoutC
stdout = strings.TrimSpace(stdout)