mirror of
https://github.com/docker/compose.git
synced 2026-08-04 14:47:40 +00:00
Add tests for ps --all
This commit is contained in:
parent
a26dd81307
commit
a0dda2d094
3 changed files with 22 additions and 4 deletions
|
|
@ -38,8 +38,8 @@ func init() {
|
|||
|
||||
type containerService struct{}
|
||||
|
||||
func (cs *containerService) List(ctx context.Context, _ bool) ([]containers.Container, error) {
|
||||
return []containers.Container{
|
||||
func (cs *containerService) List(ctx context.Context, all bool) ([]containers.Container, error) {
|
||||
result := []containers.Container{
|
||||
{
|
||||
ID: "id",
|
||||
Image: "nginx",
|
||||
|
|
@ -48,7 +48,16 @@ func (cs *containerService) List(ctx context.Context, _ bool) ([]containers.Cont
|
|||
ID: "1234",
|
||||
Image: "alpine",
|
||||
},
|
||||
}, nil
|
||||
}
|
||||
|
||||
if all {
|
||||
result = append(result, containers.Container{
|
||||
ID: "stopped",
|
||||
Image: "nginx",
|
||||
})
|
||||
}
|
||||
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func (cs *containerService) Run(ctx context.Context, r containers.ContainerConfig) error {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue