~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Vincent Ladeuil
  • Date: 2009-04-06 08:17:53 UTC
  • mto: (4241.10.1 bzr.1.14)
  • mto: This revision was merged to the branch mainline in revision 4267.
  • Revision ID: v.ladeuil+lp@free.fr-20090406081753-7kgr5pcn218zavf4
Fix most of cicp related failures on OSX.

* bzrlib/tests/blackbox/test_filesystem_cicp.py:
Fix forgotten s/added/adding/.

* bzrlib/osutils.py:
(_cicp_canonical_relpath): Should be used for Darwin too according
to tests.CaseInsCasePresFilenameFeature.

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
 
53
53
 
54
54
class TestAdd(TestCICPBase):
 
55
 
55
56
    def test_add_simple(self):
56
57
        """Test add always uses the case of the filename reported by the os."""
57
58
        wt = self.make_branch_and_tree('.')
58
59
        # create a file on disk with the mixed-case name
59
60
        self.build_tree(['CamelCase'])
60
61
 
61
 
        self.check_output('added CamelCase\n', 'add camelcase')
 
62
        self.check_output('adding CamelCase\n', 'add camelcase')
62
63
 
63
64
    def test_add_subdir(self):
64
65
        """test_add_simple but with subdirectories tested too."""
66
67
        # create a file on disk with the mixed-case parent and base name
67
68
        self.build_tree(['CamelCaseParent/', 'CamelCaseParent/CamelCase'])
68
69
 
69
 
        self.check_output('added CamelCaseParent\nadded CamelCaseParent/CamelCase\n',
 
70
        self.check_output('adding CamelCaseParent\n'
 
71
                          'adding CamelCaseParent/CamelCase\n',
70
72
                          'add camelcaseparent/camelcase')
71
73
 
72
74
    def test_add_implied(self):
75
77
        # create a file on disk with the mixed-case parent and base name
76
78
        self.build_tree(['CamelCaseParent/', 'CamelCaseParent/CamelCase'])
77
79
 
78
 
        self.check_output('added CamelCaseParent\nadded CamelCaseParent/CamelCase\n',
 
80
        self.check_output('adding CamelCaseParent\n'
 
81
                          'adding CamelCaseParent/CamelCase\n',
79
82
                          'add')
80
83
 
81
84
    def test_re_add(self):
84
87
        wt = self.make_branch_and_tree('.')
85
88
        # create a file on disk with the mixed-case name
86
89
        self.build_tree(['MixedCase'])
87
 
        self.check_output('added MixedCase\n', 'add MixedCase')
 
90
        self.check_output('adding MixedCase\n', 'add MixedCase')
88
91
        # 'accidently' rename the file on disk
89
92
        os.rename('MixedCase', 'mixedcase')
90
93
        self.check_empty_output('add mixedcase')
96
99
        wt = self.make_branch_and_tree('.')
97
100
        # create a file on disk with the mixed-case name
98
101
        self.build_tree(['MixedCaseParent/', 'MixedCaseParent/MixedCase'])
99
 
        self.check_output('added MixedCaseParent\nadded MixedCaseParent/MixedCase\n',
 
102
        self.check_output('adding MixedCaseParent\n'
 
103
                          'adding MixedCaseParent/MixedCase\n',
100
104
                          'add MixedCaseParent')
101
105
        # 'accidently' rename the directory on disk
102
106
        os.rename('MixedCaseParent', 'mixedcaseparent')
118
122
        self.run_bzr('add')
119
123
        self.run_bzr('ci -m message')
120
124
 
121
 
        self.check_output('CamelCaseParent/CamelCase => CamelCaseParent/NewCamelCase\n',
122
 
                          'mv camelcaseparent/camelcase camelcaseparent/NewCamelCase')
 
125
        self.check_output(
 
126
            'CamelCaseParent/CamelCase => CamelCaseParent/NewCamelCase\n',
 
127
            'mv camelcaseparent/camelcase camelcaseparent/NewCamelCase')
123
128
 
124
129
    def test_mv_newname_after(self):
125
130
        wt = self._make_mixed_case_tree()
129
134
 
130
135
        # In this case we can specify the incorrect case for the destination,
131
136
        # as we use --after, so the file-system is sniffed.
132
 
        self.check_output('CamelCaseParent/CamelCase => CamelCaseParent/NewCamelCase\n',
133
 
                          'mv --after camelcaseparent/camelcase camelcaseparent/newcamelcase')
 
137
        self.check_output(
 
138
            'CamelCaseParent/CamelCase => CamelCaseParent/NewCamelCase\n',
 
139
            'mv --after camelcaseparent/camelcase camelcaseparent/newcamelcase')
134
140
 
135
141
    def test_mv_newname_exists(self):
136
142
        # test a mv, but when the target already exists with a name that