コード例 #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)
コード例 #2
0
ファイル: help.py プロジェクト: pombreda/dist-packages
 def __init__(self):
     self.search_path = [
         help_topics.HelpTopicIndex(),
         _mod_commands.HelpCommandIndex(),
         plugin.PluginsHelpIndex(),
         help_topics.ConfigOptionHelpIndex(),
         ]
コード例 #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)
コード例 #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)
コード例 #5
0
 def test_prefix(self):
     """TopicIndex has a prefix of ''."""
     index = help_topics.HelpTopicIndex()
     self.assertEqual('', index.prefix)
コード例 #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'))
コード例 #7
0
 def test_default_constructable(self):
     index = help_topics.HelpTopicIndex()