~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_options.py

  • Committer: Vincent Ladeuil
  • Date: 2008-10-02 06:18:42 UTC
  • mfrom: (3757 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3759.
  • Revision ID: v.ladeuil+lp@free.fr-20081002061842-4ctag1pkr7ua9gu2
Fix conflict. Related to moved lines, nice use case

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')