Browse Source

test --all flag

Signed-off-by: Collins Abitekaniza <[email protected]>
Collins Abitekaniza 7 years ago
parent
commit
05efe52ccd
2 changed files with 9 additions and 1 deletions
  1. 1 1
      compose/cli/main.py
  2. 8 0
      tests/acceptance/cli_test.py

+ 1 - 1
compose/cli/main.py

@@ -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')

+ 8 - 0
tests/acceptance/cli_test.py

@@ -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