~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_workingtree/test_move.py

Merge pt1 hooks branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
from bzrlib import (
22
22
    errors,
23
23
    osutils,
 
24
    tests,
24
25
    )
25
26
 
26
27
from bzrlib.workingtree_4 import DirStateWorkingTreeFormat
543
544
        self.assertTreeLayout([('', root_id), ('a', 'a-id'), ('c', 'c-id'),
544
545
                               ('a/b', 'b-id')], tree.basis_tree())
545
546
        tree._validate()
 
547
 
 
548
    def test_move_to_unversioned_non_ascii_dir(self):
 
549
        """Check error when moving to unversioned non-ascii directory"""
 
550
        self.requireFeature(tests.UnicodeFilename)
 
551
        tree = self.make_branch_and_tree(".")
 
552
        self.build_tree(["a", u"\xA7/"])
 
553
        tree.add(["a"])
 
554
        e = self.assertRaises(errors.BzrMoveFailedError,
 
555
            tree.move, ["a"], u"\xA7")
 
556
        self.assertIsInstance(e.extra, errors.NotVersionedError)
 
557
        self.assertEqual(e.extra.path, u"\xA7")
 
558
 
 
559
    def test_move_unversioned_non_ascii(self):
 
560
        """Check error when moving an unversioned non-ascii file"""
 
561
        self.requireFeature(tests.UnicodeFilename)
 
562
        tree = self.make_branch_and_tree(".")
 
563
        self.build_tree([u"\xA7", "dir/"])
 
564
        tree.add("dir")
 
565
        e = self.assertRaises(errors.BzrMoveFailedError,
 
566
            tree.move, [u"\xA7"], "dir")
 
567
        self.assertIsInstance(e.extra, errors.NotVersionedError)
 
568
        self.assertEqual(e.extra.path, u"\xA7")