gopkg.in/docker/libcompose.v0@v0.4.0/integration/ps_test.go (about)

     1  package integration
     2  
     3  import (
     4  	"fmt"
     5  	"strings"
     6  
     7  	. "gopkg.in/check.v1"
     8  )
     9  
    10  func (s *CliSuite) TestPs(c *C) {
    11  	p := s.ProjectFromText(c, "up", SimpleTemplate)
    12  
    13  	name := fmt.Sprintf("%s_%s_1", p, "hello")
    14  
    15  	_, out := s.FromTextCaptureOutput(c, p, "ps", SimpleTemplate)
    16  
    17  	c.Assert(strings.Contains(out,
    18  		fmt.Sprintf(`%s  sh       Up Less than a second`, name)),
    19  		Equals, true, Commentf("%s", out))
    20  }
    21  
    22  func (s *CliSuite) TestPsQuiet(c *C) {
    23  	p := s.ProjectFromText(c, "up", SimpleTemplate)
    24  
    25  	name := fmt.Sprintf("%s_%s_1", p, "hello")
    26  	container := s.GetContainerByName(c, name)
    27  
    28  	_, out := s.FromTextCaptureOutput(c, p, "ps", "-q", SimpleTemplate)
    29  
    30  	c.Assert(strings.Contains(out,
    31  		fmt.Sprintf(`%s`, container.ID)),
    32  		Equals, true, Commentf("%s", out))
    33  }