~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: John Arbash Meinel
  • Date: 2010-08-24 19:21:32 UTC
  • mto: This revision was merged to the branch mainline in revision 5390.
  • Revision ID: john@arbash-meinel.com-20100824192132-2ktt5adkbk5bk1ct
Handle test_source and extensions. Also define an 'extern' protocol, to allow
the test suite to recognize that returning an object of that type is a Python object.

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
 
 
25
 
 
26
 
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):
27
27
 
28
28
    def test_list_alias_with_none(self):
29
29
        """Calling alias with no parameters lists existing aliases."""
46
46
 
47
47
    def test_unicode_alias(self):
48
48
        """Unicode aliases should work (Bug #529930)"""
 
49
        config_enc = 'utf-8'
49
50
        file_name = u'foo\xb6'
50
51
 
51
52
        tree = self.make_branch_and_tree('.')
53
54
        tree.add(file_name)
54
55
        tree.commit('added')
55
56
 
56
 
        config.GlobalConfig.from_string(
57
 
            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)
58
62
 
59
63
        out, err = self.run_bzr('ust')
60
64
        self.assertEquals(err, '')