~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_transform.py

  • Committer: Aaron Bentley
  • Date: 2007-08-29 05:22:21 UTC
  • mto: This revision was merged to the branch mainline in revision 2765.
  • Revision ID: aaron.bentley@utoronto.ca-20070829052221-27rynnk5yws2619u
Detect irregularities with the pending-deletion directory

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
from bzrlib.errors import (DuplicateKey, MalformedTransform, NoSuchFile,
32
32
                           ReusingTransform, CantMoveRoot, 
33
33
                           PathsNotVersionedError, ExistingLimbo,
34
 
                           ImmortalLimbo, LockError)
 
34
                           ExistingPendingDeletion, ImmortalLimbo,
 
35
                           ImmortalPendingDeletion, LockError)
35
36
from bzrlib.osutils import file_kind, has_symlinks, pathjoin
36
37
from bzrlib.merge import Merge3Merger
37
38
from bzrlib.tests import TestCaseInTempDir, TestSkipped, TestCase
68
69
        transform, root = self.get_transform()
69
70
        transform.apply()
70
71
 
 
72
    def test_existing_pending_deletion(self):
 
73
        transform, root = self.get_transform()
 
74
        deletion_path = self._limbodir = urlutils.local_path_from_url(
 
75
            transform._tree._control_files.controlfilename('pending-deletion'))
 
76
        os.mkdir(pathjoin(deletion_path, 'blocking-directory'))
 
77
        self.assertRaises(ImmortalPendingDeletion, transform.apply)
 
78
        self.assertRaises(LockError, self.wt.unlock)
 
79
        self.assertRaises(ExistingPendingDeletion, self.get_transform)
 
80
 
71
81
    def test_build(self):
72
82
        transform, root = self.get_transform() 
73
83
        self.assertIs(transform.get_tree_parent(root), ROOT_PARENT)