~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_options.py

  • Committer: Aaron Bentley
  • Date: 2007-02-07 03:40:37 UTC
  • mto: This revision was merged to the branch mainline in revision 2269.
  • Revision ID: aaron.bentley@utoronto.ca-20070207034037-sx1twhf86tvmfl5p
Add option grouping to RegistryOption and clean up format options

Show diffs side-by-side

added added

removed removed

Lines of Context:
170
170
        registry.register_metadir('two', 'RepositoryFormatKnit1', 'two help')
171
171
        registry.set_default('one')
172
172
        options = [option.RegistryOption('format', 'format help', registry,
173
 
                   str, value_switches=True)]
 
173
                   str, value_switches=True, title='Formats')]
174
174
        parser = option.get_optparser(dict((o.name, o) for o in options))
175
175
        value = parser.format_option_help()
176
176
        self.assertContainsRe(value, 'format.*format help')
177
177
        self.assertContainsRe(value, 'one.*one help')
 
178
        self.assertContainsRe(value, 'Formats:\n *--format')
178
179
 
179
180
    def test_iter_switches(self):
180
181
        opt = option.Option('hello', help='fg')