def create_help_command(self): cli_data = self._get_cli_data() return ProviderHelpCommand(self.session, self._get_command_table(), self._get_argument_table(), cli_data.get('description', None), cli_data.get('synopsis', None), cli_data.get('help_usage', None))
def _create_top_level_help(self, commands, session): command_table = self.create_command_table( commands.get('subcommands', {}), self._create_service_command) argument_table = self.create_argument_table( commands.get('arguments', [])) return ProviderHelpCommand( session, command_table, argument_table, None, None, None)
def setUp(self): super(TestProviderHelpCommand, self).setUp() self.session.provider = None self.command_table = {} self.arg_table = {} self.description = None self.synopsis = None self.usage = None # Create a temporary index file for ``aws help [command]`` to use. self.tags_dict = {'topic-name-1': {}, 'topic-name-2': {}} json_index = self.file_creator.create_file('index.json', '') with open(json_index, 'w') as f: json.dump(self.tags_dict, f, indent=4, sort_keys=True) self.json_patch = mock.patch('awscli.topictags.TopicTagDB.index_file', json_index) self.json_patch.start() self.cmd = ProviderHelpCommand(self.session, self.command_table, self.arg_table, self.description, self.synopsis, self.usage)