test --all flag

Signed-off-by: Collins Abitekaniza <abtcolns@gmail.com>
This commit is contained in:
Collins Abitekaniza 2018-11-06 14:49:56 +03:00
parent ba1e0311a7
commit 05efe52ccd
2 changed files with 9 additions and 1 deletions

View File

@ -694,7 +694,7 @@ class TopLevelCommand(object):
-q, --quiet Only display IDs
--services Display services
--filter KEY=VAL Filter services by a property
-a, --all Shows all stopped containers
-a, --all Show all stopped containers
"""
if options['--quiet'] and options['--services']:
raise UserError('--quiet and --services cannot be combined')

View File

@ -599,6 +599,14 @@ class CLITestCase(DockerClientTestCase):
assert 'with_build' in running.stdout
assert 'with_image' in running.stdout
def test_ps_all(self):
self.project.get_service('simple').create_container(one_off='blahblah')
result = self.dispatch(['ps'])
assert 'simple-composefile_simple_run_1' not in result.stdout
result2 = self.dispatch(['ps', '--all'])
assert 'simple-composefile_simple_run_1' in result2.stdout
def test_pull(self):
result = self.dispatch(['pull'])
assert 'Pulling simple' in result.stderr