~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_mv.py

  • Committer: Marius Kruger
  • Date: 2006-12-22 18:22:50 UTC
  • mto: (2220.1.1 bzr.enhanced_move)
  • mto: This revision was merged to the branch mainline in revision 2241.
  • Revision ID: amanic@gmail.com-20061222182250-mq33oq8fs45fx4sb
* Change move/rename errors yet again
  - added new exception classes BzrMoveFailedError and BzrRenameFailedError
  - convert the move/rename methods to raise these new exceptions,
    and pass more specefic exceptions as extra.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
    TestCaseWithTransport,
27
27
    TestSkipped,
28
28
    )
29
 
 
 
29
from bzrlib.osutils import (
 
30
    splitpath
 
31
    )
30
32
 
31
33
class TestMove(TestCaseWithTransport):
32
34
 
80
82
        tree.add(['test.txt'])
81
83
 
82
84
        self.run_bzr_error(
83
 
            ["^bzr: ERROR: Could not move to sub1. sub1 is not versioned$"],
 
85
            ["^bzr: ERROR: Could not move to sub1: sub1 is not versioned$"],
84
86
            'mv', 'test.txt', 'sub1')
85
87
 
86
88
        self.run_bzr_error(
87
 
            ["^bzr: ERROR: destination .* is not a versioned directory$"],
 
89
            ["^bzr: ERROR: Could not move test.txt => .*hello.txt: "
 
90
             "sub1 is not versioned$"],
88
91
            'mv', 'test.txt', 'sub1/hello.txt')
89
92
        
90
93
    def test_mv_dirs(self):
201
204
 
202
205
        os.rename('a', 'sub1/a')
203
206
        self.run_bzr_error(
204
 
            ["^bzr: ERROR: destination .* is not a versioned directory$"],
 
207
            ["^bzr: ERROR: Could not move a => a: sub1 is not versioned$"],
205
208
            'mv', 'a', 'sub1/a')
206
209
        self.failIfExists('a')
207
210
        self.failUnlessExists('sub1/a')
247
250
        tree.commit('initial commit')
248
251
 
249
252
        self.run_bzr_error(
250
 
            ["^bzr: ERROR: Files exist: a b: Could not rename a => b."
251
 
             " Use option '--after' to force rename."],
 
253
            ["^bzr: ERROR: Could not rename a => b: Files exist: a b:"
 
254
             " \(Use option '--after' to force rename\)$"],
252
255
            'mv', 'a', 'b')
253
256
        self.failUnlessExists('a')
254
257
        self.failUnlessExists('b')
275
278
        tree.commit('initial commit')
276
279
 
277
280
        self.run_bzr_error(
278
 
            ["^bzr: ERROR: Files exist: a1 .*a1: Could not rename a1 => a1."
279
 
             " Use option '--after' to force rename."],
 
281
            ["^bzr: ERROR: Could not rename a1 => a1: Files exist: a1 .*a1:"
 
282
             " \(Use option '--after' to force rename\)$"],
280
283
            'mv', 'a1', 'a2', 'sub1')
281
284
        self.failUnlessExists('a1')
282
285
        self.failUnlessExists('a2')