~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 00:34:03 UTC
  • mto: This revision was merged to the branch mainline in revision 2441.
  • Revision ID: robertc@robertcollins.net-20070420003403-0055vwwp20sdtpti
HelpContexts.search now returns the found topics.

Show diffs side-by-side

added added

removed removed

Lines of Context:
105
105
            ('get_topics', '2', 'bar'),
106
106
            ],
107
107
            calls)
 
108
 
 
109
    def test_search_returns_context_results(self):
 
110
        """Searching should return all the help topics found."""
 
111
        class CannedContext(object):
 
112
            def __init__(self, search_result):
 
113
                self.result = search_result
 
114
            def get_topics(self, topic):
 
115
                return self.result
 
116
        contexts = help.HelpContexts()
 
117
        contexts.search_path = [CannedContext(['a']), CannedContext(['b', 'c'])]
 
118
        self.assertEqual(['a', 'b', 'c'], contexts.search(None))