~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Andrew Bennetts
  • Date: 2010-07-29 11:17:57 UTC
  • mfrom: (5050.3.17 2.2)
  • mto: This revision was merged to the branch mainline in revision 5365.
  • Revision ID: andrew.bennetts@canonical.com-20100729111757-018h3pcefo7z0dnq
Merge lp:bzr/2.2 into lp:bzr.

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
 
 
20
 
from bzrlib import (
21
 
    config,
22
 
    tests,
23
 
    )
24
 
from bzrlib.tests import (
25
 
    features,
26
 
    )
27
 
 
28
 
 
29
 
class TestAlias(tests.TestCaseWithTransport):
 
19
import os
 
20
import codecs
 
21
 
 
22
from bzrlib.tests import TestCaseWithTransport
 
23
from bzrlib.config import (ensure_config_dir_exists, config_filename)
 
24
 
 
25
 
 
26
class TestAlias(TestCaseWithTransport):
30
27
 
31
28
    def test_list_alias_with_none(self):
32
29
        """Calling alias with no parameters lists existing aliases."""
49
46
 
50
47
    def test_unicode_alias(self):
51
48
        """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)
 
49
        config_enc = 'utf-8'
55
50
        file_name = u'foo\xb6'
56
51
 
57
52
        tree = self.make_branch_and_tree('.')
59
54
        tree.add(file_name)
60
55
        tree.commit('added')
61
56
 
62
 
        config.GlobalConfig.from_string(
63
 
            u'[ALIASES]\nust=st %s\n' % (file_name,), save=True)
 
57
        ensure_config_dir_exists()
 
58
        CONFIG=(u'[ALIASES]\n'
 
59
                u'ust=st foo\xb6\n')
 
60
 
 
61
        codecs.open(config_filename(),'w', config_enc).write(CONFIG)
64
62
 
65
63
        out, err = self.run_bzr('ust')
66
64
        self.assertEquals(err, '')