~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/workingtree_implementations/test_parents.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:
32
32
    InventoryLink,
33
33
    )
34
34
from bzrlib.revision import Revision
35
 
from bzrlib.tests import SymlinkFeature, TestNotApplicable
 
35
from bzrlib.tests import (
 
36
    KnownFailure,
 
37
    SymlinkFeature,
 
38
    TestNotApplicable,
 
39
    UnicodeFilenameFeature,
 
40
    )
36
41
from bzrlib.tests.workingtree_implementations import TestCaseWithWorkingTree
37
42
from bzrlib.uncommit import uncommit
38
43
 
227
232
                            (rev3, rev_tree3)])
228
233
        self.assertConsistentParents([rev2, rev3], t)
229
234
 
 
235
    def test_unicode_symlink(self):
 
236
        # this tests bug #272444
 
237
        self.requireFeature(SymlinkFeature)
 
238
        self.requireFeature(UnicodeFilenameFeature)
 
239
 
 
240
        tree = self.make_branch_and_tree('tree1')
 
241
 
 
242
        # The link points to a file whose name is an omega
 
243
        # U+03A9 GREEK CAPITAL LETTER OMEGA
 
244
        # UTF-8: ce a9  UTF-16BE: 03a9  Decimal: Ω
 
245
        os.symlink(u'\u03a9','tree1/link_name')
 
246
        tree.add(['link_name'],['link-id'])
 
247
 
 
248
        try:
 
249
            # the actual commit occurs without errors (strangely):
 
250
            revision1 = tree.commit('added a link to a Unicode target')
 
251
            # python 2.4 failed with UnicodeDecodeError on this commit:
 
252
            revision2 = tree.commit('this revision will be discarded')
 
253
            # python 2.5 failed with UnicodeEncodeError on set_parent_ids:
 
254
            tree.set_parent_ids([revision1])
 
255
        except (UnicodeEncodeError, UnicodeDecodeError):
 
256
            raise KnownFailure('there is no support for'
 
257
                               ' symlinks to non-ASCII targets (bug #272444)')
 
258
 
230
259
 
231
260
class TestAddParent(TestParents):
232
261