示例#1
0
 def __init__(self):
     self.search_path = [
         help_topics.HelpTopicIndex(),
         _mod_commands.HelpCommandIndex(),
         plugin.PluginsHelpIndex(),
         help_topics.ConfigOptionHelpIndex(),
         ]
示例#2
0
 def test_skipped_on_HelpCommandIndex_get_topics(self):
     # The get_missing_command(cmd_name) hook is not fired when
     # looking up help topics.
     self.hook_missing()
     topic = commands.HelpCommandIndex()
     topics = topic.get_topics('foo')
     self.assertEqual([], self.hook_calls)
示例#3
0
 def test_get_topic_with_prefix(self):
     """Searching for commands/rocks returns the rocks command object."""
     index = commands.HelpCommandIndex()
     topics = index.get_topics('commands/rocks')
     self.assertEqual(1, len(topics))
     self.assertIsInstance(topics[0], builtins.cmd_rocks)
示例#4
0
 def test_prefix(self):
     """CommandIndex has a prefix of 'commands/'."""
     index = commands.HelpCommandIndex()
     self.assertEqual('commands/', index.prefix)
示例#5
0
 def test_get_topics_no_topic(self):
     """Searching for something that is not a command returns []."""
     index = commands.HelpCommandIndex()
     self.assertEqual([], index.get_topics('nothing by this name'))
示例#6
0
 def test_get_topics_rocks(self):
     """Searching for 'rocks' returns the cmd_rocks command instance."""
     index = commands.HelpCommandIndex()
     topics = index.get_topics('rocks')
     self.assertEqual(1, len(topics))
     self.assertIsInstance(topics[0], builtins.cmd_rocks)
示例#7
0
 def test_get_topics_None(self):
     """Searching for None returns an empty list."""
     index = commands.HelpCommandIndex()
     self.assertEqual([], index.get_topics(None))
示例#8
0
 def test_default_constructable(self):
     index = commands.HelpCommandIndex()