~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_options.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-10-01 07:56:03 UTC
  • mfrom: (3224.5.40 faster-startup)
  • Revision ID: pqm@pqm.ubuntu.com-20081001075603-s9nynw8y85fmrprj
Reduce startup time by a small amount. (Andrew Bennetts)

Show diffs side-by-side

added added

removed removed

Lines of Context:
151
151
        self.assertIsInstance(opts.format.repository_format,
152
152
                              knitrepo.RepositoryFormatKnit1)
153
153
 
 
154
    def test_lazy_registry(self):
 
155
        options = [option.RegistryOption('format', '',
 
156
                   lazy_registry=('bzrlib.bzrdir','format_registry'),
 
157
                   converter=str)]
 
158
        opts, args = self.parse(options, ['--format', 'knit'])
 
159
        self.assertEqual({'format': 'knit'}, opts)
 
160
        self.assertRaises(
 
161
            errors.BadOptionValue, self.parse, options, ['--format', 'BAD'])
 
162
 
154
163
    def test_from_kwargs(self):
155
164
        my_option = option.RegistryOption.from_kwargs('my-option',
156
165
            help='test option', short='be short', be_long='go long')