/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: Martin Pool
  • Date: 2011-06-10 07:32:35 UTC
  • mfrom: (5966 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5970.
  • Revision ID: mbp@canonical.com-20110610073235-kg8gxj34p84qq70m
merge news

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
    controldir,
23
23
    errors,
24
24
    option,
 
25
    registry,
25
26
    )
26
27
from bzrlib.builtins import cmd_commit
27
28
from bzrlib.commands import parse_args
412
413
        self.assertEqual('suggest lottery numbers', my_opt.help)
413
414
        self.assertEqual(orig_help, the_opt.help)
414
415
 
 
416
    def test_short_value_switches(self):
 
417
        reg = registry.Registry()
 
418
        reg.register('short', 'ShortChoice')
 
419
        reg.register('long', 'LongChoice')
 
420
        ropt = option.RegistryOption('choice', '', reg, value_switches=True,
 
421
            short_value_switches={'short': 's'})
 
422
        opts, args = parse([ropt], ['--short'])
 
423
        self.assertEqual('ShortChoice', opts.choice)
 
424
        opts, args = parse([ropt], ['-s'])
 
425
        self.assertEqual('ShortChoice', opts.choice)
 
426
 
415
427
 
416
428
class TestVerboseQuietLinkage(TestCase):
417
429