~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Samuel Bronson
  • Date: 2012-08-30 20:36:18 UTC
  • mto: (6015.57.3 2.4)
  • mto: This revision was merged to the branch mainline in revision 6558.
  • Revision ID: naesten@gmail.com-20120830203618-y2dzw91nqpvpgxvx
Update INSTALL for switch to Python 2.6 and up.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006-2012 Canonical Ltd
 
1
# Copyright (C) 2006-2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
25
25
    )
26
26
 
27
27
from bzrlib.tests import (
28
 
    TestCaseWithTransport,
29
 
    )
30
 
from bzrlib.tests.features import (
31
28
    CaseInsensitiveFilesystemFeature,
32
29
    SymlinkFeature,
33
 
    UnicodeFilenameFeature,
 
30
    TestCaseWithTransport,
 
31
    UnicodeFilename,
34
32
    )
35
33
 
36
34
 
120
118
        tree = self.make_branch_and_tree('.')
121
119
        tree.add(['sub1', 'sub1/sub2', 'sub1/hello.txt'])
122
120
 
123
 
        self.run_bzr('mv ../hello.txt .', working_dir='sub1/sub2')
124
 
        self.assertPathExists('sub1/sub2/hello.txt')
 
121
        os.chdir('sub1/sub2')
 
122
        self.run_bzr('mv ../hello.txt .')
 
123
        self.assertPathExists('./hello.txt')
125
124
 
126
 
        self.run_bzr('mv sub2/hello.txt .', working_dir='sub1')
 
125
        os.chdir('..')
 
126
        self.run_bzr('mv sub2/hello.txt .')
 
127
        os.chdir('..')
127
128
        self.assertMoved('sub1/sub2/hello.txt','sub1/hello.txt')
128
129
 
129
130
    def test_mv_change_case_file(self):
184
185
        self.run_bzr('move a b')
185
186
        self.run_bzr('rename b a')
186
187
 
187
 
    def test_mv_no_root(self):
188
 
        tree = self.make_branch_and_tree('.')
189
 
        self.run_bzr_error(
190
 
            ["bzr: ERROR: can not move root of branch"],
191
 
            'mv . a')
192
 
 
193
188
    def test_mv_through_symlinks(self):
194
189
        self.requireFeature(SymlinkFeature)
195
190
        tree = self.make_branch_and_tree('.')
513
508
 
514
509
    def test_mv_unversioned_non_ascii(self):
515
510
        """Clear error on mv of an unversioned non-ascii file, see lp:707954"""
516
 
        self.requireFeature(UnicodeFilenameFeature)
 
511
        self.requireFeature(UnicodeFilename)
517
512
        tree = self.make_branch_and_tree(".")
518
513
        self.build_tree([u"\xA7"])
519
514
        out, err = self.run_bzr_error(["Could not rename", "not versioned"],
520
515
            ["mv", u"\xA7", "b"])
521
 
 
522
 
    def test_mv_removed_non_ascii(self):
523
 
        """Clear error on mv of a removed non-ascii file, see lp:898541"""
524
 
        self.requireFeature(UnicodeFilenameFeature)
525
 
        tree = self.make_branch_and_tree(".")
526
 
        self.build_tree([u"\xA7"])
527
 
        tree.add([u"\xA7"])
528
 
        tree.commit(u"Adding \xA7")
529
 
        os.remove(u"\xA7")
530
 
        out, err = self.run_bzr_error(["Could not rename", "not exist"],
531
 
            ["mv", u"\xA7", "b"])