~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/branch_implementations/test_sprout.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-11-27 06:01:33 UTC
  • mfrom: (3763.9.13 tests7)
  • Revision ID: pqm@pqm.ubuntu.com-20081127060133-uxj1a237vdm65w3d
(mbp) add xfail tests for unicode symlink targets

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""Tests for Branch.sprout()"""
18
18
 
 
19
import os
19
20
from bzrlib import (
20
21
    remote,
21
22
    revision as _mod_revision,
22
23
    tests,
23
24
    )
 
25
from bzrlib.tests import KnownFailure, SymlinkFeature, UnicodeFilenameFeature
24
26
from bzrlib.tests.branch_implementations import TestCaseWithBranch
25
27
 
26
28
 
97
99
            revision_id='rev1a').open_workingtree()
98
100
        self.assertEqual('rev1a', wt2.last_revision())
99
101
        self.failUnlessExists('target/a')
 
102
 
 
103
    def test_sprout_with_unicode_symlink(self):
 
104
        # this tests bug #272444
 
105
        # Since the trigger function seems to be set_parent_trees, there exists
 
106
        # also a similar test, with name test_unicode_symlink, in class
 
107
        # TestSetParents at file workingtree_implementations/test_parents.py
 
108
        self.requireFeature(SymlinkFeature)
 
109
        self.requireFeature(UnicodeFilenameFeature)
 
110
 
 
111
        tree = self.make_branch_and_tree('tree1')
 
112
 
 
113
        # The link points to a file whose name is an omega
 
114
        # U+03A9 GREEK CAPITAL LETTER OMEGA
 
115
        # UTF-8: ce a9  UTF-16BE: 03a9  Decimal: Ω
 
116
        os.symlink(u'\u03a9','tree1/link_name')
 
117
        tree.add(['link_name'],['link-id'])
 
118
 
 
119
        try:
 
120
            # python 2.7a0 failed on commit:
 
121
            revision = tree.commit('added a link to a Unicode target')
 
122
            # python 2.5 failed on sprout:
 
123
            tree.bzrdir.sprout('target')
 
124
        except UnicodeEncodeError, e:
 
125
            raise KnownFailure('there is no support for'
 
126
                               ' symlinks to non-ASCII targets (bug #272444)')
 
127