~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-01-21 17:22:25 UTC
  • mfrom: (5626.1.1 trunk)
  • Revision ID: pqm@pqm.ubuntu.com-20110121172225-7mybq84k4ikcails
(vila) Merge 2.3 into trunk including bugfix for #701940 (Vincent
        Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005-2010 Canonical Ltd
 
1
# Copyright (C) 2005-2011 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
24
24
    option,
25
25
    )
26
26
from bzrlib.builtins import cmd_commit
27
 
from bzrlib.commands import Command, parse_args
 
27
from bzrlib.commands import parse_args
28
28
from bzrlib.tests import TestCase
29
29
from bzrlib.repofmt import knitrepo
30
30
 
396
396
        self.assertTrue(format.is_hidden('hidden'))
397
397
        self.assertFalse(format.is_hidden('visible'))
398
398
 
 
399
    def test_short_name(self):
 
400
        registry = controldir.ControlDirFormatRegistry()
 
401
        opt = option.RegistryOption('format', help='', registry=registry)
 
402
        self.assertEquals(None, opt.short_name())
 
403
        opt = option.RegistryOption('format', short_name='F', help='',
 
404
            registry=registry)
 
405
        self.assertEquals('F', opt.short_name())
 
406
 
399
407
    def test_option_custom_help(self):
400
408
        the_opt = option.Option.OPTIONS['help']
401
409
        orig_help = the_opt.help[:]