Merge pull request #1578 from aanand/fix-migrate-help
Fix 'docker-compose help migrate-to-labels'
This commit is contained in:
commit
c8751980f9
3 changed files with 46 additions and 10 deletions
|
|
@ -11,6 +11,7 @@ import mock
|
|||
|
||||
from compose.cli import main
|
||||
from compose.cli.main import TopLevelCommand
|
||||
from compose.cli.docopt_command import NoSuchCommand
|
||||
from compose.cli.errors import ComposeFileNotFound
|
||||
from compose.service import Service
|
||||
|
||||
|
|
@ -101,6 +102,22 @@ class CLITestCase(unittest.TestCase):
|
|||
with self.assertRaises(SystemExit):
|
||||
command.dispatch(['-h'], None)
|
||||
|
||||
def test_command_help(self):
|
||||
with self.assertRaises(SystemExit) as ctx:
|
||||
TopLevelCommand().dispatch(['help', 'up'], None)
|
||||
|
||||
self.assertIn('Usage: up', str(ctx.exception))
|
||||
|
||||
def test_command_help_dashes(self):
|
||||
with self.assertRaises(SystemExit) as ctx:
|
||||
TopLevelCommand().dispatch(['help', 'migrate-to-labels'], None)
|
||||
|
||||
self.assertIn('Usage: migrate-to-labels', str(ctx.exception))
|
||||
|
||||
def test_command_help_nonexistent(self):
|
||||
with self.assertRaises(NoSuchCommand):
|
||||
TopLevelCommand().dispatch(['help', 'nonexistent'], None)
|
||||
|
||||
def test_setup_logging(self):
|
||||
main.setup_logging()
|
||||
self.assertEqual(logging.getLogger().level, logging.DEBUG)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue