~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_commands.py

  • Committer: Vincent Ladeuil
  • Date: 2010-07-15 13:05:40 UTC
  • mto: This revision was merged to the branch mainline in revision 5347.
  • Revision ID: v.ladeuil+lp@free.fr-20100715130540-nac9q1yu78870v0e
Delete the after_cleanup_size parameter from the LRUCache constructor.

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):
109
 
        my_config = config.GlobalConfig.from_string(config_text)
 
98
        my_config = config.GlobalConfig()
 
99
        config_file = StringIO(config_text.encode('utf-8'))
 
100
        my_config._parser = my_config._get_parser(file=config_file)
110
101
        return my_config
111
102
 
112
103
    def test_simple(self):
355
346
        self.assertEqual(['called'], hook_calls)
356
347
        self.assertSubset(['foo', 'bar'], cmds)
357
348
 
358
 
 
359
349
class TestDeprecations(tests.TestCase):
360
350
 
361
351
    def test_shlex_split_unicode_deprecation(self):