~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: 2011-06-08 13:51:30 UTC
  • mfrom: (5945.1.5 bug38655-short-log)
  • Revision ID: pqm@pqm.ubuntu.com-20110608135130-lmzibvvzxrxwci0t
(vila) Allow -S as shorthand for --log-format=short (Martin von Gagern)

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