~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_commands.py

  • Committer: Martin Pool
  • Date: 2011-03-28 01:28:09 UTC
  • mto: (5425.4.19 220464-stale-locks)
  • mto: This revision was merged to the branch mainline in revision 5970.
  • Revision ID: mbp@canonical.com-20110328012809-frw003r09tcrxkiz
Represent lock held info as an object, not just a dict

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005-2011 Canonical Ltd
 
1
# Copyright (C) 2005-2010 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
17
18
import errno
18
19
import inspect
19
20
import sys
91
92
        self.assertContainsRe(c.get_help_text(), '--foo')
92
93
 
93
94
 
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
 
 
106
95
class TestGetAlias(tests.TestCase):
107
96
 
108
97
    def _get_config(self, config_text):