~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_help.py

  • Committer: Martin
  • Date: 2011-03-22 00:33:21 UTC
  • mto: This revision was merged to the branch mainline in revision 5731.
  • Revision ID: gzlist@googlemail.com-20110322003321-h3n4q806g759tk7v
Tweak function descriptions in delta header for clarity

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2007-2010 Canonical Ltd
 
1
# Copyright (C) 2007-2011 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
16
16
 
17
17
"""Unit tests for the bzrlib.help module."""
18
18
 
19
 
from cStringIO import StringIO
20
 
 
21
19
from bzrlib import (
22
20
    builtins,
23
21
    commands,
112
110
                Example 2::
113
111
 
114
112
                    cmd arg2
 
113
 
 
114
                A code block follows.
 
115
 
 
116
                ::
 
117
 
 
118
                    bzr Demo something
115
119
            """
116
120
        cmd = cmd_Demo()
117
121
        helptext = cmd.get_help_text()
122
126
            '\n'
123
127
            'Options:\n'
124
128
            '  --usage        Show usage message and options.\n'
125
 
            '  -0, --null     Use an ASCII NUL (\\0) separator rather than a newline.\n'
126
129
            '  -v, --verbose  Display more information.\n'
127
130
            '  -q, --quiet    Only display errors and warnings.\n'
128
131
            '  -h, --help     Show help message.\n'
135
138
            '    Example 2:\n'
136
139
            '\n'
137
140
            '        cmd arg2\n'
 
141
            '\n'
 
142
            '    A code block follows.\n'
 
143
            '\n'
 
144
            '        bzr Demo something\n'
138
145
            '\n')
139
146
        helptext = cmd.get_help_text(plain=False)
140
147
        self.assertEquals(helptext,
143
150
            '\n'
144
151
            ':Options:\n'
145
152
            '  --usage        Show usage message and options.\n'
146
 
            '  -0, --null     Use an ASCII NUL (\\0) separator rather than a newline.\n'
147
153
            '  -v, --verbose  Display more information.\n'
148
154
            '  -q, --quiet    Only display errors and warnings.\n'
149
155
            '  -h, --help     Show help message.\n'
156
162
            '    Example 2::\n'
157
163
            '\n'
158
164
            '        cmd arg2\n'
 
165
            '\n'
 
166
            '    A code block follows.\n'
 
167
            '\n'
 
168
            '    ::\n'
 
169
            '\n'
 
170
            '        bzr Demo something\n'
159
171
            '\n')
160
172
 
161
173
    def test_concise_help_text(self):
179
191
            '\n'
180
192
            'Options:\n'
181
193
            '  --usage        Show usage message and options.\n'
182
 
            '  -0, --null     Use an ASCII NUL (\\0) separator rather than a newline.\n'
183
194
            '  -v, --verbose  Display more information.\n'
184
195
            '  -q, --quiet    Only display errors and warnings.\n'
185
196
            '  -h, --help     Show help message.\n'
199
210
            '\n'
200
211
            'Options:\n'
201
212
            '  --usage        Show usage message and options.\n'
202
 
            '  -0, --null     Use an ASCII NUL (\\0) separator rather than a newline.\n'
203
213
            '  -v, --verbose  Display more information.\n'
204
214
            '  -q, --quiet    Only display errors and warnings.\n'
205
215
            '  -h, --help     Show help message.\n'
234
244
            '\n'
235
245
            'Options:\n'
236
246
            '  --usage        Show usage message and options.\n'
237
 
            '  -0, --null     Use an ASCII NUL (\\0) separator rather than a newline.\n'
238
247
            '  -v, --verbose  Display more information.\n'
239
248
            '  -q, --quiet    Only display errors and warnings.\n'
240
249
            '  -h, --help     Show help message.\n'
278
287
            '\n'
279
288
            'Options:\n'
280
289
            '  --usage        Show usage message and options.\n'
281
 
            '  -0, --null     Use an ASCII NUL (\\0) separator rather than a newline.\n'
282
290
            '  -v, --verbose  Display more information.\n'
283
291
            '  -q, --quiet    Only display errors and warnings.\n'
284
292
            '  -h, --help     Show help message.\n'