~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Martin Pool
  • Date: 2009-09-14 02:30:23 UTC
  • mto: This revision was merged to the branch mainline in revision 4693.
  • Revision ID: mbp@sourcefrog.net-20090914023023-ros0f3ndo04j3bww
Clearer docs about bzr help.  (Thanks to Naoki)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2008, 2009, 2010 Canonical Ltd
 
1
# Copyright (C) 2005, 2006, 2007 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
17
17
 
18
18
"""Tests of the 'bzr alias' command."""
19
19
 
20
 
from bzrlib import (
21
 
    config,
22
 
    tests,
23
 
    )
24
 
 
25
 
 
26
 
class TestAlias(tests.TestCaseWithTransport):
 
20
from bzrlib.tests.blackbox import ExternalBase
 
21
 
 
22
 
 
23
class TestAlias(ExternalBase):
27
24
 
28
25
    def test_list_alias_with_none(self):
29
26
        """Calling alias with no parameters lists existing aliases."""
44
41
        out, err = self.run_bzr('alias commit')
45
42
        self.assertEquals('bzr alias commit="commit --strict"\n', out)
46
43
 
47
 
    def test_unicode_alias(self):
48
 
        """Unicode aliases should work (Bug #529930)"""
49
 
        # XXX: strictly speaking, lack of unicode filenames doesn't imply that
50
 
        # unicode command lines aren't available.
51
 
        self.requireFeature(tests.UnicodeFilenameFeature)
52
 
        file_name = u'foo\xb6'
53
 
 
54
 
        tree = self.make_branch_and_tree('.')
55
 
        self.build_tree([file_name])
56
 
        tree.add(file_name)
57
 
        tree.commit('added')
58
 
 
59
 
        config.GlobalConfig.from_string(
60
 
            u'[ALIASES]\nust=st %s\n' % (file_name,), save=True)
61
 
 
62
 
        out, err = self.run_bzr('ust')
63
 
        self.assertEquals(err, '')
64
 
        self.assertEquals(out, '')
65
 
 
66
44
    def test_alias_listing_alphabetical(self):
67
45
        self.run_bzr('alias commit="commit --strict"')
68
46
        self.run_bzr('alias ll="log --short"')