# Path: cliff/command.py
# def _get_distributions_by_modules():
# def _get_distribution_for_module(module):
#     def __init__(self, app, app_args, cmd_name=None):
#     def _load_hooks(self):
#     def get_description(self):
#     def get_epilog(self):
#     def get_parser(self, prog_name):
#     def take_action(self, parsed_args):
#     def run(self, parsed_args):
#     def _run_before_hooks(self, parsed_args):
#     def _run_after_hooks(self, parsed_args, return_code):
# class Command(object, metaclass=abc.ABCMeta):
# 
# Path: cliff/commandmanager.py
# LOG = logging.getLogger(__name__)
# def _get_commands_by_partial_name(args, commands):
#     def __init__(self, name, command_class):
#     def load(self, require=False):
#     def __init__(self, namespace, convert_underscores=True):
#     def _load_commands(self):
#     def load_commands(self, namespace):
#     def __iter__(self):
#     def add_command(self, name, command_class):
#     def add_legacy_command(self, old_name, new_name):
#     def find_command(self, argv):
#     def _get_last_possible_command_index(self, argv):
#     def add_command_group(self, group=None):
#     def get_command_groups(self):
#     def get_command_names(self, group=None):
# class EntryPointWrapper(object):
# class CommandManager(object):


import testscenarios
from unittest import mock
from cliff import command
from cliff import commandmanager
from cliff.tests import base
from cliff.tests import utils

    scenarios = [
        ('one-word', {'argv': ['o']}),
        ('two-words', {'argv': ['t', 'w']}),
        ('three-words', {'argv': ['t', 'w', 'c']}),
    ]

    def test(self):
        mgr = utils.TestCommandManager(utils.TEST_NAMESPACE)
        cmd, name, remaining = mgr.find_command(self.argv)
        self.assertTrue(cmd)
        self.assertEqual(' '.join(self.argv), name)
        self.assertFalse(remaining)


class TestGetByPartialName(base.TestBase):

    def setUp(self):
        super(TestGetByPartialName, self).setUp()
        self.commands = {
            'resource provider list': 1,
            'resource class list': 2,
            'server list': 3,
            'service list': 4}

    def test_no_candidates(self):
        self.assertEqual(
            [], commandmanager._get_commands_by_partial_name(
                ['r', 'p'], self.commands))
        self.assertEqual(

# Path: cliff/command.py
# def _get_distributions_by_modules():
# def _get_distribution_for_module(module):
#     def __init__(self, app, app_args, cmd_name=None):
#     def _load_hooks(self):
#     def get_description(self):
#     def get_epilog(self):
#     def get_parser(self, prog_name):
#     def take_action(self, parsed_args):
#     def run(self, parsed_args):
#     def _run_before_hooks(self, parsed_args):
#     def _run_after_hooks(self, parsed_args, return_code):
# class Command(object, metaclass=abc.ABCMeta):
# 
# Path: cliff/commandmanager.py
# LOG = logging.getLogger(__name__)
# def _get_commands_by_partial_name(args, commands):
#     def __init__(self, name, command_class):
#     def load(self, require=False):
#     def __init__(self, namespace, convert_underscores=True):
#     def _load_commands(self):
#     def load_commands(self, namespace):
#     def __iter__(self):
#     def add_command(self, name, command_class):
#     def add_legacy_command(self, old_name, new_name):
#     def find_command(self, argv):
#     def _get_last_possible_command_index(self, argv):
#     def add_command_group(self, group=None):
#     def get_command_groups(self):
#     def get_command_names(self, group=None):
# class EntryPointWrapper(object):
# class CommandManager(object):


# Path: cliff/tests/test_commandmanager.py
import testscenarios
from unittest import mock
from cliff import command
from cliff import commandmanager
from cliff.tests import base
from cliff.tests import utils


    scenarios = [
        ('one-word', {'argv': ['o']}),
        ('two-words', {'argv': ['t', 'w']}),
        ('three-words', {'argv': ['t', 'w', 'c']}),
    ]

    def test(self):
        mgr = utils.TestCommandManager(utils.TEST_NAMESPACE)
        cmd, name, remaining = mgr.find_command(self.argv)
        self.assertTrue(cmd)
        self.assertEqual(' '.join(self.argv), name)
        self.assertFalse(remaining)


class TestGetByPartialName(base.TestBase):

    def setUp(self):
        super(TestGetByPartialName, self).setUp()
        self.commands = {
            'resource provider list': 1,
            'resource class list': 2,
            'server list': 3,
            'service list': 4}

    def test_no_candidates(self):
        self.assertEqual(
            [], commandmanager._get_commands_by_partial_name(
                ['r', 'p'], self.commands))
        self.assertEqual(

            [], commandmanager._get_commands_by_partial_name(