~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Patch Queue Manager
  • Date: 2015-10-05 13:45:00 UTC
  • mfrom: (6603.3.1 bts794146)
  • Revision ID: pqm@pqm.ubuntu.com-20151005134500-v244rho557tv0ukd
(vila) Resolve Bug #1480015: Test failure: hexify removed from paramiko
 (Andrew Starr-Bochicchio) (Andrew Starr-Bochicchio)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006-2010 Canonical Ltd
 
1
# Copyright (C) 2006-2012 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 (
28
31
    CaseInsensitiveFilesystemFeature,
29
32
    SymlinkFeature,
30
 
    TestCaseWithTransport,
31
 
    UnicodeFilename,
 
33
    UnicodeFilenameFeature,
32
34
    )
33
35
 
34
36
 
118
120
        tree = self.make_branch_and_tree('.')
119
121
        tree.add(['sub1', 'sub1/sub2', 'sub1/hello.txt'])
120
122
 
121
 
        os.chdir('sub1/sub2')
122
 
        self.run_bzr('mv ../hello.txt .')
123
 
        self.assertPathExists('./hello.txt')
 
123
        self.run_bzr('mv ../hello.txt .', working_dir='sub1/sub2')
 
124
        self.assertPathExists('sub1/sub2/hello.txt')
124
125
 
125
 
        os.chdir('..')
126
 
        self.run_bzr('mv sub2/hello.txt .')
127
 
        os.chdir('..')
 
126
        self.run_bzr('mv sub2/hello.txt .', working_dir='sub1')
128
127
        self.assertMoved('sub1/sub2/hello.txt','sub1/hello.txt')
129
128
 
130
129
    def test_mv_change_case_file(self):
185
184
        self.run_bzr('move a b')
186
185
        self.run_bzr('rename b a')
187
186
 
 
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
 
188
193
    def test_mv_through_symlinks(self):
189
194
        self.requireFeature(SymlinkFeature)
190
195
        tree = self.make_branch_and_tree('.')
508
513
 
509
514
    def test_mv_unversioned_non_ascii(self):
510
515
        """Clear error on mv of an unversioned non-ascii file, see lp:707954"""
511
 
        self.requireFeature(UnicodeFilename)
 
516
        self.requireFeature(UnicodeFilenameFeature)
512
517
        tree = self.make_branch_and_tree(".")
513
518
        self.build_tree([u"\xA7"])
514
519
        out, err = self.run_bzr_error(["Could not rename", "not versioned"],
515
520
            ["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"])