~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_alias.py

  • Committer: Patch Queue Manager
  • Date: 2011-09-22 13:22:18 UTC
  • mfrom: (6155.2.2 migrate-config-options)
  • Revision ID: pqm@pqm.ubuntu.com-20110922132218-nitl31j5slbcmnm2
(vila) Migrate dpush_strict,
 push_strict and send_strict options to the stack based config design,
 introducing get_config_stack for branches (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2006, 2007 Canonical Ltd
 
1
# Copyright (C) 2008, 2009, 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
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
#
17
17
 
18
18
"""Tests of the 'bzr alias' command."""
19
19
 
20
 
from bzrlib.tests.blackbox import ExternalBase
21
 
 
22
 
 
23
 
class TestAlias(ExternalBase):
 
20
from bzrlib import (
 
21
    config,
 
22
    tests,
 
23
    )
 
24
from bzrlib.tests import (
 
25
    features,
 
26
    )
 
27
 
 
28
 
 
29
class TestAlias(tests.TestCaseWithTransport):
24
30
 
25
31
    def test_list_alias_with_none(self):
26
32
        """Calling alias with no parameters lists existing aliases."""
41
47
        out, err = self.run_bzr('alias commit')
42
48
        self.assertEquals('bzr alias commit="commit --strict"\n', out)
43
49
 
 
50
    def test_unicode_alias(self):
 
51
        """Unicode aliases should work (Bug #529930)"""
 
52
        # XXX: strictly speaking, lack of unicode filenames doesn't imply that
 
53
        # unicode command lines aren't available.
 
54
        self.requireFeature(features.UnicodeFilenameFeature)
 
55
        file_name = u'foo\xb6'
 
56
 
 
57
        tree = self.make_branch_and_tree('.')
 
58
        self.build_tree([file_name])
 
59
        tree.add(file_name)
 
60
        tree.commit('added')
 
61
 
 
62
        config.GlobalConfig.from_string(
 
63
            u'[ALIASES]\nust=st %s\n' % (file_name,), save=True)
 
64
 
 
65
        out, err = self.run_bzr('ust')
 
66
        self.assertEquals(err, '')
 
67
        self.assertEquals(out, '')
 
68
 
44
69
    def test_alias_listing_alphabetical(self):
45
70
        self.run_bzr('alias commit="commit --strict"')
46
71
        self.run_bzr('alias ll="log --short"')