~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_transform.py

  • Committer: Jelmer Vernooij
  • Date: 2011-01-13 01:32:26 UTC
  • mfrom: (5606 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5607.
  • Revision ID: jelmer@samba.org-20110113013226-1d41bwtmps9y68wm
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006-2010 Canonical Ltd
 
1
# Copyright (C) 2006-2011 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
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
 
17
import errno
17
18
import os
18
19
from StringIO import StringIO
19
20
import sys
52
53
    ImmortalPendingDeletion,
53
54
    LockError,
54
55
    MalformedTransform,
55
 
    NoSuchFile,
56
56
    ReusingTransform,
57
57
)
58
58
from bzrlib.osutils import (
64
64
    features,
65
65
    HardlinkFeature,
66
66
    SymlinkFeature,
67
 
    TestCase,
68
67
    TestCaseInTempDir,
69
68
    TestSkipped,
70
69
)
74
73
    cook_conflicts,
75
74
    _FileMover,
76
75
    FinalPaths,
77
 
    get_backup_name,
78
76
    resolve_conflicts,
79
77
    resolve_checkout,
80
78
    ROOT_PARENT,
900
898
        # On windows looks like:
901
899
        # "Failed to rename .../work/myfile to 
902
900
        # .../work/.bzr/checkout/limbo/new-1: [Errno 13] Permission denied"
903
 
        # The strerror will vary per OS and language so it's not checked here
904
 
        self.assertContainsRe(str(e),
905
 
            "Failed to rename .*(first-dir.newname:|myfile)")
 
901
        # This test isn't concerned with exactly what the error looks like,
 
902
        # and the strerror will vary across OS and locales, but the assert
 
903
        # that the exeception attributes are what we expect
 
904
        self.assertEqual(e.errno, errno.EACCES)
 
905
        if os.name == "posix":
 
906
            self.assertEndsWith(e.to_path, "/first-dir/newname")
 
907
        else:
 
908
            self.assertEqual(os.path.basename(e.from_path), "myfile")
906
909
 
907
910
    def test_set_executability_order(self):
908
911
        """Ensure that executability behaves the same, no matter what order.