mirror of https://github.com/docker/compose.git
Remove unused global_options arg from dispatch()
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
This commit is contained in:
parent
2c75a8fdf5
commit
575b48749d
|
@ -20,12 +20,12 @@ class DocoptCommand(object):
|
|||
return {'options_first': True}
|
||||
|
||||
def sys_dispatch(self):
|
||||
self.dispatch(sys.argv[1:], None)
|
||||
self.dispatch(sys.argv[1:])
|
||||
|
||||
def dispatch(self, argv, global_options):
|
||||
self.perform_command(*self.parse(argv, global_options))
|
||||
def dispatch(self, argv):
|
||||
self.perform_command(*self.parse(argv))
|
||||
|
||||
def parse(self, argv, global_options):
|
||||
def parse(self, argv):
|
||||
options = docopt_full_help(getdoc(self), argv, **self.docopt_options())
|
||||
command = options['COMMAND']
|
||||
|
||||
|
|
|
@ -66,17 +66,17 @@ class CLITestCase(unittest.TestCase):
|
|||
def test_help(self):
|
||||
command = TopLevelCommand()
|
||||
with self.assertRaises(SystemExit):
|
||||
command.dispatch(['-h'], None)
|
||||
command.dispatch(['-h'])
|
||||
|
||||
def test_command_help(self):
|
||||
with self.assertRaises(SystemExit) as ctx:
|
||||
TopLevelCommand().dispatch(['help', 'up'], None)
|
||||
TopLevelCommand().dispatch(['help', 'up'])
|
||||
|
||||
self.assertIn('Usage: up', str(ctx.exception))
|
||||
|
||||
def test_command_help_nonexistent(self):
|
||||
with self.assertRaises(NoSuchCommand):
|
||||
TopLevelCommand().dispatch(['help', 'nonexistent'], None)
|
||||
TopLevelCommand().dispatch(['help', 'nonexistent'])
|
||||
|
||||
@pytest.mark.xfail(IS_WINDOWS_PLATFORM, reason="requires dockerpty")
|
||||
@mock.patch('compose.cli.main.RunOperation', autospec=True)
|
||||
|
|
Loading…
Reference in New Issue