Exemplo n.º 1
0
    def execute(self, args):
        parser = core.CommandParser(self.env)
        if not any([args['<command>'], args['<module>']]):
            return parser.get_module_help('help')

        self.env.load_module(args['<module>'])

        if args['<command>']:
            return parser.get_command_help(args['<module>'], args['<command>'])
        elif args['<module>']:
            return parser.get_module_help(args['<module>'])
Exemplo n.º 2
0
 def test_module_with_no_command(self):
     self.env.plugins = {
         'vs': {
             'list': SubmoduleFixture,
             None: SubmoduleFixture
         }
     }
     self.env.get_module_name.return_value = 'vs'
     self.env.load_module = mock.MagicMock()
     self.env.load_module.return_value = module_no_command_fixture
     resolver = core.CommandParser(self.env)
     command, command_args = resolver.parse(['vs', 'list'])
     self.assertEqual(SubmoduleFixture, command)
Exemplo n.º 3
0
 def set_up(self):
     self.env = EnvironmentFixture()
     self.parser = core.CommandParser(self.env)