~bzr/ubuntu/lucid/bzr/beta-ppa

« back to all changes in this revision

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

  • Committer: Max Bowsher
  • Date: 2011-02-09 04:08:25 UTC
  • mfrom: (0.5074.6 lucid)
  • Revision ID: maxb@f2s.com-20110209040825-7jqm4i78b8ojoy9z
Merge beta-ppa into ppa upon release of 2.3.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
#
17
17
 
18
18
"""Tests of the 'bzr alias' command."""
19
 
import codecs
20
 
 
21
 
from bzrlib.tests import TestCaseWithTransport, UnicodeFilenameFeature
22
 
from bzrlib.config import (ensure_config_dir_exists, config_filename)
23
 
 
24
 
 
25
 
class TestAlias(TestCaseWithTransport):
 
19
 
 
20
from bzrlib import (
 
21
    config,
 
22
    tests,
 
23
    )
 
24
 
 
25
 
 
26
class TestAlias(tests.TestCaseWithTransport):
26
27
 
27
28
    def test_list_alias_with_none(self):
28
29
        """Calling alias with no parameters lists existing aliases."""
47
48
        """Unicode aliases should work (Bug #529930)"""
48
49
        # XXX: strictly speaking, lack of unicode filenames doesn't imply that
49
50
        # unicode command lines aren't available.
50
 
        self.requireFeature(UnicodeFilenameFeature)
51
 
        config_enc = 'utf-8'
 
51
        self.requireFeature(tests.UnicodeFilenameFeature)
52
52
        file_name = u'foo\xb6'
53
53
 
54
54
        tree = self.make_branch_and_tree('.')
56
56
        tree.add(file_name)
57
57
        tree.commit('added')
58
58
 
59
 
        ensure_config_dir_exists()
60
 
        CONFIG=(u'[ALIASES]\n'
61
 
                u'ust=st foo\xb6\n')
62
 
 
63
 
        codecs.open(config_filename(),'w', config_enc).write(CONFIG)
 
59
        config.GlobalConfig.from_string(
 
60
            u'[ALIASES]\nust=st %s\n' % (file_name,), save=True)
64
61
 
65
62
        out, err = self.run_bzr('ust')
66
63
        self.assertEquals(err, '')