~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_commands.py

  • Committer: Vincent Ladeuil
  • Date: 2011-05-17 20:58:43 UTC
  • mfrom: (5609.39.5 2.3)
  • mto: This revision was merged to the branch mainline in revision 5885.
  • Revision ID: v.ladeuil+lp@free.fr-20110517205843-uo1tntrz6kqfn1hb
Merge 2.3 into trunk

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
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
 
from cStringIO import StringIO
18
17
import errno
19
18
import inspect
20
19
import sys
92
91
        self.assertContainsRe(c.get_help_text(), '--foo')
93
92
 
94
93
 
 
94
class TestInvokedAs(tests.TestCase):
 
95
 
 
96
    def test_invoked_as(self):
 
97
        """The command object knows the actual name used to invoke it."""
 
98
        commands.install_bzr_command_hooks()
 
99
        commands._register_builtin_commands()
 
100
        # get one from the real get_cmd_object.
 
101
        c = commands.get_cmd_object('ci')
 
102
        self.assertIsInstance(c, builtins.cmd_commit)
 
103
        self.assertEquals(c.invoked_as, 'ci')
 
104
 
 
105
 
95
106
class TestGetAlias(tests.TestCase):
96
107
 
97
108
    def _get_config(self, config_text):