Exemplo n.º 1
0
 def test_search_checks_for_duplicate_prefixes(self):
     """Its an error when there are multiple indices with the same prefix."""
     indices = help.HelpIndices()
     indices.search_path = [
         help_topics.HelpTopicIndex(),
         help_topics.HelpTopicIndex()
     ]
     self.assertRaises(errors.DuplicateHelpPrefix, indices.search, None)
Exemplo n.º 2
0
 def __init__(self):
     self.search_path = [
         help_topics.HelpTopicIndex(),
         _mod_commands.HelpCommandIndex(),
         plugin.PluginsHelpIndex(),
         help_topics.ConfigOptionHelpIndex(),
         ]
Exemplo n.º 3
0
 def test_get_topics_topics(self):
     """Searching for a string returns the matching string."""
     index = help_topics.HelpTopicIndex()
     topics = index.get_topics('topics')
     self.assertEqual(1, len(topics))
     self.assertIsInstance(topics[0], help_topics.RegisteredTopic)
     self.assertEqual('topics', topics[0].topic)
Exemplo n.º 4
0
 def test_get_topics_None(self):
     """Searching for None returns the basic help topic."""
     index = help_topics.HelpTopicIndex()
     topics = index.get_topics(None)
     self.assertEqual(1, len(topics))
     self.assertIsInstance(topics[0], help_topics.RegisteredTopic)
     self.assertEqual('basic', topics[0].topic)
Exemplo n.º 5
0
 def test_prefix(self):
     """TopicIndex has a prefix of ''."""
     index = help_topics.HelpTopicIndex()
     self.assertEqual('', index.prefix)
Exemplo n.º 6
0
 def test_get_topics_no_topic(self):
     """Searching for something not registered returns []."""
     index = help_topics.HelpTopicIndex()
     self.assertEqual([], index.get_topics('nothing by this name'))
Exemplo n.º 7
0
 def test_default_constructable(self):
     index = help_topics.HelpTopicIndex()