/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_options.py

  • Committer: Aaron Bentley
  • Date: 2007-02-16 07:02:19 UTC
  • mfrom: (2292 +trunk)
  • mto: (2255.6.1 dirstate)
  • mto: This revision was merged to the branch mainline in revision 2322.
  • Revision ID: aaron.bentley@utoronto.ca-20070216070219-b22k0gwnisnxawnk
Merged bzr.dev (17 tests failing)

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
from bzrlib.builtins import cmd_commit, cmd_log, cmd_status
26
26
from bzrlib.commands import Command, parse_args
27
27
from bzrlib.tests import TestCase
 
28
from bzrlib.repofmt import knitrepo
28
29
 
29
30
def parse(options, args):
30
31
    parser = option.get_optparser(dict((o.name, o) for o in options))
162
163
                   bzrdir.format_registry, bzrdir.format_registry.make_bzrdir)]
163
164
        opts, args = self.parse(options, ['--format', 'knit'])
164
165
        self.assertIsInstance(opts.format.repository_format,
165
 
                              repository.RepositoryFormatKnit1)
 
166
                              knitrepo.RepositoryFormatKnit1)
166
167
 
167
168
    def test_help(self):
168
169
        registry = bzrdir.BzrDirFormatRegistry()
169
170
        registry.register_metadir('one', 'RepositoryFormat7', 'one help')
170
 
        registry.register_metadir('two', 'RepositoryFormatKnit1', 'two help')
 
171
        registry.register_metadir('two',
 
172
            'bzrlib.repofmt.knitrepo.RepositoryFormatKnit1',
 
173
            'two help',
 
174
            )
171
175
        registry.set_default('one')
172
176
        options = [option.RegistryOption('format', 'format help', registry,
173
177
                   str, value_switches=True, title='Formats')]
189
193
                         [('hello', None, 'GAR', 'fg')])
190
194
        registry = bzrdir.BzrDirFormatRegistry()
191
195
        registry.register_metadir('one', 'RepositoryFormat7', 'one help')
192
 
        registry.register_metadir('two', 'RepositoryFormatKnit1', 'two help')
 
196
        registry.register_metadir('two',
 
197
                'bzrlib.repofmt.knitrepo.RepositoryFormatKnit1',
 
198
                'two help',
 
199
                )
193
200
        registry.set_default('one')
194
201
        opt = option.RegistryOption('format', 'format help', registry,
195
202
                                    value_switches=False)