/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_help.py

  • Committer: Robert Collins
  • Date: 2009-03-13 02:25:46 UTC
  • mfrom: (4133 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4183.
  • Revision ID: robertc@robertcollins.net-20090313022546-e7de5zsdkbay5okf
MergeĀ .dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
96
96
        """Help text should be plain text by default."""
97
97
        class cmd_Demo(commands.Command):
98
98
            """A sample command.
99
 
 
 
99
 
100
100
            :Examples:
101
101
                Example 1::
102
 
 
 
102
 
103
103
                    cmd arg1
104
 
 
 
104
 
105
105
                Example 2::
106
 
 
 
106
 
107
107
                    cmd arg2
108
108
            """
109
109
        cmd = cmd_Demo()
151
151
        """Help text may contain a custom usage section."""
152
152
        class cmd_Demo(commands.Command):
153
153
            """A sample command.
154
 
 
 
154
 
155
155
            :Usage:
156
156
                cmd Demo [opts] args
157
 
 
 
157
 
158
158
                cmd Demo -h
159
 
 
 
159
 
160
160
            Blah blah blah.
161
161
            """
162
162
        cmd = cmd_Demo()
183
183
 
184
184
    def test_contruct(self):
185
185
        """Construction takes the help topic name for the registered item."""
186
 
        # validate our test 
 
186
        # validate our test
187
187
        self.assertTrue('basic' in help_topics.topic_registry)
188
188
        topic = help_topics.RegisteredTopic('basic')
189
189
        self.assertEqual('basic', topic.topic)
203
203
 
204
204
    def test_get_help_text_loaded_from_file(self):
205
205
        # Pick a known topic stored in an external file
206
 
        topic = help_topics.RegisteredTopic('hooks')
 
206
        topic = help_topics.RegisteredTopic('authentication')
207
207
        self.assertStartsWith(topic.get_help_text(),
208
 
            'Hooks\n'
209
 
            '=====\n'
 
208
            'Authentication Settings\n'
 
209
            '=======================\n'
210
210
            '\n')
211
211
 
212
212
    def test_get_help_topic(self):