~lifeless/ubuntu/lucid/bzr/2.1.2-sru

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Jelmer Vernooij
  • Date: 2009-06-27 15:23:34 UTC
  • mfrom: (1.3.1 upstream) (3.1.78 karmic)
  • Revision ID: james.westby@ubuntu.com-20090627152334-u3smexjpaolh96qd
* New upstream release.
* Bump standards version to 3.8.2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
#
17
17
 
18
18
"""Tests variations of case-insensitive and case-preserving file-systems."""
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