/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/tree_implementations/test_path_content_summary.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-01-30 18:55:42 UTC
  • mfrom: (3949.6.6 unicode-symlinks)
  • Revision ID: pqm@pqm.ubuntu.com-20090130185542-dbj7mapm1fvtwm3y
(Jelmer) Support symlinks with unicode characters in the symlink name.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
import os
20
20
 
21
 
from bzrlib.osutils import supports_executable
 
21
from bzrlib.osutils import supports_executable, _fs_enc
22
22
from bzrlib.tests import SymlinkFeature, TestSkipped, TestNotApplicable
23
23
from bzrlib.tests.tree_implementations import TestCaseWithTree
24
24
 
39
39
        summary = self._convert_tree(tree).path_content_summary('path')
40
40
        self.assertEqual(('symlink', None, None, 'target'), summary)
41
41
 
 
42
    def test_unicode_symlink_content_summary(self):
 
43
        self.requireFeature(SymlinkFeature)
 
44
        tree = self.make_branch_and_tree('tree')
 
45
        try:
 
46
            os.symlink('target', u'tree/\u03b2-path'.encode(_fs_enc))
 
47
        except UnicodeError:
 
48
            raise TestSkipped(
 
49
                'This platform does not support unicode file paths.')
 
50
 
 
51
        tree.add([u'\u03b2-path'])
 
52
        summary = self._convert_tree(tree).path_content_summary(u'\u03b2-path')
 
53
        self.assertEqual(('symlink', None, None, 'target'), summary)
 
54
 
42
55
    def test_missing_content_summary(self):
43
56
        tree = self.make_branch_and_tree('tree')
44
57
        summary = self._convert_tree(tree).path_content_summary('path')