~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_help.py

  • Committer: Robert Collins
  • Date: 2007-04-20 02:56:44 UTC
  • mto: This revision was merged to the branch mainline in revision 2441.
  • Revision ID: robertc@robertcollins.net-20070420025644-sxlhafhnmv46xgfs
Correct spelling of Indexs to Indices.

Show diffs side-by-side

added added

removed removed

Lines of Context:
122
122
        self.assertEqual([], index.get_topics('nothing by this name'))
123
123
 
124
124
 
125
 
class TestHelpIndexs(tests.TestCase):
126
 
    """Tests for the HelpIndexs class."""
 
125
class TestHelpIndices(tests.TestCase):
 
126
    """Tests for the HelpIndices class."""
127
127
 
128
128
    def test_default_search_path(self):
129
129
        """The default search path should include internal indexs."""
130
 
        indexs = help.HelpIndexs()
131
 
        self.assertEqual(2, len(indexs.search_path))
 
130
        indices = help.HelpIndices()
 
131
        self.assertEqual(2, len(indices.search_path))
132
132
        # help topics should be searched in first.
133
 
        self.assertIsInstance(indexs.search_path[0],
 
133
        self.assertIsInstance(indices.search_path[0],
134
134
            help_topics.HelpTopicIndex)
135
135
        # with commands being search second.
136
 
        self.assertIsInstance(indexs.search_path[1],
 
136
        self.assertIsInstance(indices.search_path[1],
137
137
            commands.HelpCommandIndex)
138
138
 
139
139
    def test_search_for_unknown_topic_raises(self):
140
140
        """Searching for an unknown topic should raise NoHelpTopic."""
141
 
        indexs = help.HelpIndexs()
142
 
        indexs.search_path = []
143
 
        error = self.assertRaises(errors.NoHelpTopic, indexs.search, 'foo')
 
141
        indices = help.HelpIndices()
 
142
        indices.search_path = []
 
143
        error = self.assertRaises(errors.NoHelpTopic, indices.search, 'foo')
144
144
        self.assertEqual('foo', error.topic)
145
145
 
146
146
    def test_search_calls_get_topic(self):
152
152
            def get_topics(self, topic):
153
153
                calls.append(('get_topics', self.name, topic))
154
154
                return ['something']
155
 
        index = help.HelpIndexs()
 
155
        index = help.HelpIndices()
156
156
        index.search_path = [RecordingIndex('1'), RecordingIndex('2')]
157
157
        # try with None
158
158
        index.search(None)
177
177
                self.result = search_result
178
178
            def get_topics(self, topic):
179
179
                return self.result
180
 
        index = help.HelpIndexs()
 
180
        index = help.HelpIndices()
181
181
        index.search_path = [CannedIndex(['a']), CannedIndex(['b', 'c'])]
182
182
        self.assertEqual(['a', 'b', 'c'], index.search(None))