/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar
4988.10.5 by John Arbash Meinel
Merge bzr.dev 5021 to resolve NEWS
1
# Copyright (C) 2007, 2009, 2010 Canonical Ltd
2255.2.62 by John Arbash Meinel
add a workingtree_implementations test that makes sure smart_add_tree orks properly
2
#
3
# This program is free software; you can redistribute it and/or modify
4
# it under the terms of the GNU General Public License as published by
5
# the Free Software Foundation; either version 2 of the License, or
6
# (at your option) any later version.
7
#
8
# This program is distributed in the hope that it will be useful,
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
# GNU General Public License for more details.
12
#
13
# You should have received a copy of the GNU General Public License
14
# along with this program; if not, write to the Free Software
4183.7.1 by Sabin Iacob
update FSF mailing address
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2255.2.62 by John Arbash Meinel
add a workingtree_implementations test that makes sure smart_add_tree orks properly
16
17
"""Test that we can use smart_add on all Tree implementations."""
18
2568.2.4 by Robert Collins
* ``bzrlib.add.smart_add`` and ``bzrlib.add.smart_add_tree`` are now
19
from cStringIO import StringIO
5378.1.1 by Martin
Add per_workingtree tests in add and smart_add for bug 205636
20
import os
4789.11.1 by John Arbash Meinel
Skip the assertFilenameSkipped tests on Windows.
21
import sys
2568.2.4 by Robert Collins
* ``bzrlib.add.smart_add`` and ``bzrlib.add.smart_add_tree`` are now
22
2255.2.62 by John Arbash Meinel
add a workingtree_implementations test that makes sure smart_add_tree orks properly
23
from bzrlib import (
24
    errors,
2568.2.4 by Robert Collins
* ``bzrlib.add.smart_add`` and ``bzrlib.add.smart_add_tree`` are now
25
    ignores,
26
    osutils,
2568.2.10 by Robert Collins
And a missing import.
27
    tests,
2255.2.62 by John Arbash Meinel
add a workingtree_implementations test that makes sure smart_add_tree orks properly
28
    )
5013.2.2 by Vincent Ladeuil
Fix imports in per_workingtree/test_smart_add.py.
29
from bzrlib.tests import (
5967.12.1 by Martin Pool
Move all test features into bzrlib.tests.features
30
    features,
31
    per_workingtree,
5013.2.2 by Vincent Ladeuil
Fix imports in per_workingtree/test_smart_add.py.
32
    test_smart_add,
2255.7.92 by Martin Pool
Test for smart_add(save=false) should be run against all WorkingTrees; adjust the test to more precisely cover the contract.
33
    )
5013.2.2 by Vincent Ladeuil
Fix imports in per_workingtree/test_smart_add.py.
34
35
36
class TestSmartAddTree(per_workingtree.TestCaseWithWorkingTree):
2255.2.62 by John Arbash Meinel
add a workingtree_implementations test that makes sure smart_add_tree orks properly
37
38
    def test_single_file(self):
39
        tree = self.make_branch_and_tree('tree')
40
        self.build_tree(['tree/a'])
2568.2.4 by Robert Collins
* ``bzrlib.add.smart_add`` and ``bzrlib.add.smart_add_tree`` are now
41
        tree.smart_add(['tree'])
2255.2.62 by John Arbash Meinel
add a workingtree_implementations test that makes sure smart_add_tree orks properly
42
43
        tree.lock_read()
44
        try:
45
            files = [(path, status, kind)
46
                     for path, status, kind, file_id, parent_id
47
                      in tree.list_files(include_root=True)]
48
        finally:
49
            tree.unlock()
50
        self.assertEqual([('', 'V', 'directory'), ('a', 'V', 'file')],
51
                         files)
2255.7.92 by Martin Pool
Test for smart_add(save=false) should be run against all WorkingTrees; adjust the test to more precisely cover the contract.
52
4634.55.1 by Robert Collins
Do not add files whose name contains new lines or carriage returns
53
    def assertFilenameSkipped(self, filename):
54
        tree = self.make_branch_and_tree('tree')
4789.11.1 by John Arbash Meinel
Skip the assertFilenameSkipped tests on Windows.
55
        try:
56
            self.build_tree(['tree/'+filename])
57
        except errors.NoSuchFile:
58
            if sys.platform == 'win32':
59
                raise tests.TestNotApplicable('Cannot create files named %r on'
60
                    ' win32' % (filename,))
4634.55.1 by Robert Collins
Do not add files whose name contains new lines or carriage returns
61
        tree.smart_add(['tree'])
62
        self.assertEqual(None, tree.path2id(filename))
63
64
    def test_path_containing_newline_skips(self):
65
        self.assertFilenameSkipped('a\nb')
66
67
    def test_path_containing_carriagereturn_skips(self):
68
        self.assertFilenameSkipped('a\rb')
69
2255.7.92 by Martin Pool
Test for smart_add(save=false) should be run against all WorkingTrees; adjust the test to more precisely cover the contract.
70
    def test_save_false(self):
71
        """Dry-run add doesn't permanently affect the tree."""
72
        wt = self.make_branch_and_tree('.')
2585.1.1 by Aaron Bentley
Unify MutableTree.smart_add behavior by disabling quirky memory-only Inventory
73
        wt.lock_write()
74
        try:
75
            self.build_tree(['file'])
76
            wt.smart_add(['file'], save=False)
77
            # the file should not be added - no id.
78
            self.assertEqual(wt.path2id('file'), None)
79
        finally:
80
            wt.unlock()
2568.2.4 by Robert Collins
* ``bzrlib.add.smart_add`` and ``bzrlib.add.smart_add_tree`` are now
81
        # and the disk state should be the same - reopen to check.
2255.7.92 by Martin Pool
Test for smart_add(save=false) should be run against all WorkingTrees; adjust the test to more precisely cover the contract.
82
        wt = wt.bzrdir.open_workingtree()
83
        self.assertEqual(wt.path2id('file'), None)
2568.2.4 by Robert Collins
* ``bzrlib.add.smart_add`` and ``bzrlib.add.smart_add_tree`` are now
84
85
    def test_add_dot_from_root(self):
3943.8.1 by Marius Kruger
remove all trailing whitespace from bzr source
86
        """Test adding . from the root of the tree."""
2568.2.4 by Robert Collins
* ``bzrlib.add.smart_add`` and ``bzrlib.add.smart_add_tree`` are now
87
        paths = ("original/", "original/file1", "original/file2")
88
        self.build_tree(paths)
89
        wt = self.make_branch_and_tree('.')
90
        wt.smart_add((u".",))
91
        for path in paths:
92
            self.assertNotEqual(wt.path2id(path), None)
93
94
    def test_add_dot_from_subdir(self):
3943.8.1 by Marius Kruger
remove all trailing whitespace from bzr source
95
        """Test adding . from a subdir of the tree."""
2568.2.4 by Robert Collins
* ``bzrlib.add.smart_add`` and ``bzrlib.add.smart_add_tree`` are now
96
        paths = ("original/", "original/file1", "original/file2")
97
        self.build_tree(paths)
98
        wt = self.make_branch_and_tree('.')
99
        wt.smart_add((u".",))
100
        for path in paths:
101
            self.assertNotEqual(wt.path2id(path), None)
102
103
    def test_add_tree_from_above_tree(self):
3943.8.1 by Marius Kruger
remove all trailing whitespace from bzr source
104
        """Test adding a tree from above the tree."""
2568.2.4 by Robert Collins
* ``bzrlib.add.smart_add`` and ``bzrlib.add.smart_add_tree`` are now
105
        paths = ("original/", "original/file1", "original/file2")
106
        branch_paths = ("branch/", "branch/original/", "branch/original/file1",
107
                        "branch/original/file2")
108
        self.build_tree(branch_paths)
109
        wt = self.make_branch_and_tree('branch')
110
        wt.smart_add(("branch",))
111
        for path in paths:
112
            self.assertNotEqual(wt.path2id(path), None)
113
114
    def test_add_above_tree_preserves_tree(self):
115
        """Test nested trees are not affect by an add above them."""
116
        paths = ("original/", "original/file1", "original/file2")
117
        child_paths = ("path",)
118
        full_child_paths = ("original/child", "original/child/path")
3943.8.1 by Marius Kruger
remove all trailing whitespace from bzr source
119
        build_paths = ("original/", "original/file1", "original/file2",
2568.2.4 by Robert Collins
* ``bzrlib.add.smart_add`` and ``bzrlib.add.smart_add_tree`` are now
120
                       "original/child/", "original/child/path")
3943.8.1 by Marius Kruger
remove all trailing whitespace from bzr source
121
2568.2.4 by Robert Collins
* ``bzrlib.add.smart_add`` and ``bzrlib.add.smart_add_tree`` are now
122
        self.build_tree(build_paths)
123
        wt = self.make_branch_and_tree('.')
124
        child_tree = self.make_branch_and_tree('original/child')
125
        wt.smart_add((".",))
126
        for path in paths:
127
            self.assertNotEqual((path, wt.path2id(path)),
128
                                (path, None))
129
        for path in full_child_paths:
130
            self.assertEqual((path, wt.path2id(path)),
131
                             (path, None))
132
        for path in child_paths:
133
            self.assertEqual(child_tree.path2id(path), None)
134
135
    def test_add_paths(self):
136
        """Test smart-adding a list of paths."""
137
        paths = ("file1", "file2")
138
        self.build_tree(paths)
139
        wt = self.make_branch_and_tree('.')
140
        wt.smart_add(paths)
141
        for path in paths:
142
            self.assertNotEqual(wt.path2id(path), None)
3943.8.1 by Marius Kruger
remove all trailing whitespace from bzr source
143
2568.2.4 by Robert Collins
* ``bzrlib.add.smart_add`` and ``bzrlib.add.smart_add_tree`` are now
144
    def test_add_ignored_nested_paths(self):
145
        """Test smart-adding a list of paths which includes ignored ones."""
146
        wt = self.make_branch_and_tree('.')
147
        tree_shape = ("adir/", "adir/CVS/", "adir/CVS/afile", "adir/CVS/afile2")
148
        add_paths = ("adir/CVS", "adir/CVS/afile", "adir")
149
        expected_paths = ("adir", "adir/CVS", "adir/CVS/afile", "adir/CVS/afile2")
150
        self.build_tree(tree_shape)
151
        wt.smart_add(add_paths)
152
        for path in expected_paths:
153
            self.assertNotEqual(wt.path2id(path), None, "No id added for %s" % path)
154
155
    def test_add_non_existant(self):
156
        """Test smart-adding a file that does not exist."""
157
        wt = self.make_branch_and_tree('.')
158
        self.assertRaises(errors.NoSuchFile, wt.smart_add, ['non-existant-file'])
159
160
    def test_returns_and_ignores(self):
161
        """Correctly returns added/ignored files"""
162
        wt = self.make_branch_and_tree('.')
163
        # The default ignore list includes '*.py[co]', but not CVS
164
        ignores._set_user_ignores(['*.py[co]'])
165
        self.build_tree(['inertiatic/', 'inertiatic/esp', 'inertiatic/CVS',
166
                        'inertiatic/foo.pyc'])
167
        added, ignored = wt.smart_add(u'.')
168
        self.assertSubset(('inertiatic', 'inertiatic/esp', 'inertiatic/CVS'),
169
                          added)
170
        self.assertSubset(('*.py[co]',), ignored)
171
        self.assertSubset(('inertiatic/foo.pyc',), ignored['*.py[co]'])
172
173
    def test_add_multiple_dirs(self):
174
        """Test smart adding multiple directories at once."""
175
        added_paths = ['file1', 'file2',
176
                       'dir1/', 'dir1/file3',
177
                       'dir1/subdir2/', 'dir1/subdir2/file4',
178
                       'dir2/', 'dir2/file5',
179
                      ]
180
        not_added = ['file6', 'dir3/', 'dir3/file7', 'dir3/file8']
181
        self.build_tree(added_paths)
182
        self.build_tree(not_added)
183
184
        wt = self.make_branch_and_tree('.')
185
        wt.smart_add(['file1', 'file2', 'dir1', 'dir2'])
186
187
        for path in added_paths:
188
            self.assertNotEqual(None, wt.path2id(path.rstrip('/')),
189
                    'Failed to add path: %s' % (path,))
190
        for path in not_added:
191
            self.assertEqual(None, wt.path2id(path.rstrip('/')),
192
                    'Accidentally added path: %s' % (path,))
193
4163.2.1 by Ian Clatworthy
Fix add in trees supports views
194
    def test_add_file_in_unknown_dir(self):
195
        # Test that parent directory addition is implicit
196
        tree = self.make_branch_and_tree('.')
197
        self.build_tree(['dir/', 'dir/subdir/', 'dir/subdir/foo'])
198
        tree.smart_add(['dir/subdir/foo'])
199
        tree.lock_read()
200
        self.addCleanup(tree.unlock)
201
        self.assertEqual(['', 'dir', 'dir/subdir', 'dir/subdir/foo'],
202
            [path for path, ie in tree.iter_entries_by_dir()])
203
5504.6.2 by Martin
If a dir being added used to be something else detect and correct
204
    def test_add_dir_bug_251864(self):
5504.6.3 by Martin
Address poolie's review, mention both bugs in test and add news
205
        """Added file turning into a dir should be detected on add dir
206
207
        Similar to bug 205636 but with automatic adding of directory contents.
208
        """
5378.1.1 by Martin
Add per_workingtree tests in add and smart_add for bug 205636
209
        tree = self.make_branch_and_tree(".")
210
        self.build_tree(["dir"]) # whoops, make a file called dir
211
        tree.smart_add(["dir"])
212
        os.remove("dir")
213
        self.build_tree(["dir/", "dir/file"])
5504.6.2 by Martin
If a dir being added used to be something else detect and correct
214
        tree.smart_add(["dir"])
5378.1.1 by Martin
Add per_workingtree tests in add and smart_add for bug 205636
215
        tree.commit("Add dir contents")
5378.1.4 by Martin
Assert state of the tree after add and commit in new tests
216
        self.addCleanup(tree.lock_read().unlock)
217
        self.assertEqual([(u"dir", "directory"), (u"dir/file", "file")],
218
            [(t[0], t[2]) for t in tree.list_files()])
219
        self.assertFalse(list(tree.iter_changes(tree.basis_tree())))
5378.1.1 by Martin
Add per_workingtree tests in add and smart_add for bug 205636
220
221
    def test_add_subdir_file_bug_205636(self):
222
        """Added file turning into a dir should be detected on add dir/file"""
223
        tree = self.make_branch_and_tree(".")
224
        self.build_tree(["dir"]) # whoops, make a file called dir
225
        tree.smart_add(["dir"])
226
        os.remove("dir")
227
        self.build_tree(["dir/", "dir/file"])
5378.1.3 by Martin
Note that TestSmartAddTree.test_add_subdir_file_bug_205636 now passes
228
        tree.smart_add(["dir/file"])
5378.1.1 by Martin
Add per_workingtree tests in add and smart_add for bug 205636
229
        tree.commit("Add file in dir")
5378.1.4 by Martin
Assert state of the tree after add and commit in new tests
230
        self.addCleanup(tree.lock_read().unlock)
231
        self.assertEqual([(u"dir", "directory"), (u"dir/file", "file")],
232
            [(t[0], t[2]) for t in tree.list_files()])
233
        self.assertFalse(list(tree.iter_changes(tree.basis_tree())))
5378.1.1 by Martin
Add per_workingtree tests in add and smart_add for bug 205636
234
2568.2.4 by Robert Collins
* ``bzrlib.add.smart_add`` and ``bzrlib.add.smart_add_tree`` are now
235
    def test_custom_ids(self):
236
        sio = StringIO()
5013.2.2 by Vincent Ladeuil
Fix imports in per_workingtree/test_smart_add.py.
237
        action = test_smart_add.AddCustomIDAction(to_file=sio,
238
                                                  should_print=True)
2568.2.4 by Robert Collins
* ``bzrlib.add.smart_add`` and ``bzrlib.add.smart_add_tree`` are now
239
        self.build_tree(['file1', 'dir1/', 'dir1/file2'])
240
241
        wt = self.make_branch_and_tree('.')
242
        wt.smart_add(['.'], action=action)
243
        # The order of adds is not strictly fixed:
244
        sio.seek(0)
245
        lines = sorted(sio.readlines())
3985.2.5 by Daniel Watkins
Reverted some irrelevant changes.
246
        self.assertEqualDiff(['added dir1 with id directory-dir1\n',
247
                              'added dir1/file2 with id file-dir1%file2\n',
248
                              'added file1 with id file-file1\n',
249
                             ], lines)
2568.2.4 by Robert Collins
* ``bzrlib.add.smart_add`` and ``bzrlib.add.smart_add_tree`` are now
250
        wt.lock_read()
251
        self.addCleanup(wt.unlock)
252
        self.assertEqual([('', wt.path2id('')),
253
                          ('dir1', 'directory-dir1'),
5807.1.8 by Jelmer Vernooij
Fix some tests.
254
                          ('file1', 'file-file1'),
2568.2.4 by Robert Collins
* ``bzrlib.add.smart_add`` and ``bzrlib.add.smart_add_tree`` are now
255
                          ('dir1/file2', 'file-dir1%file2'),
256
                         ], [(path, ie.file_id) for path, ie
5807.1.8 by Jelmer Vernooij
Fix some tests.
257
                                in wt.iter_entries_by_dir()])
2568.2.4 by Robert Collins
* ``bzrlib.add.smart_add`` and ``bzrlib.add.smart_add_tree`` are now
258
5013.2.3 by Vincent Ladeuil
Simplify some tests in per_workingtree/test_smart_add.py.
259
5013.2.4 by Vincent Ladeuil
``bzr add`` won't blindly add conflict related files.
260
class TestSmartAddConflictRelatedFiles(per_workingtree.TestCaseWithWorkingTree):
261
262
    def make_tree_with_text_conflict(self):
263
        tb = self.make_branch_and_tree('base')
264
        self.build_tree_contents([('base/file', 'content in base')])
265
        tb.add('file')
266
        tb.commit('Adding file')
267
268
        t1 = tb.bzrdir.sprout('t1').open_workingtree()
269
270
        self.build_tree_contents([('base/file', 'content changed in base')])
271
        tb.commit('Changing file in base')
272
273
        self.build_tree_contents([('t1/file', 'content in t1')])
274
        t1.commit('Changing file in t1')
275
        t1.merge_from_branch(tb.branch)
276
        return t1
277
278
    def test_cant_add_generated_files_implicitly(self):
279
        t = self.make_tree_with_text_conflict()
280
        added, ignored = t.smart_add([t.basedir])
281
        self.assertEqual(([], {}), (added, ignored))
282
283
    def test_can_add_generated_files_explicitly(self):
284
        fnames = ['file.%s' % s  for s in ('BASE', 'THIS', 'OTHER')]
285
        t = self.make_tree_with_text_conflict()
286
        added, ignored = t.smart_add([t.basedir + '/%s' % f for f in fnames])
287
        self.assertEqual((fnames, {}), (added, ignored))
288
289
5013.2.3 by Vincent Ladeuil
Simplify some tests in per_workingtree/test_smart_add.py.
290
class TestSmartAddTreeUnicode(per_workingtree.TestCaseWithWorkingTree):
291
5967.12.1 by Martin Pool
Move all test features into bzrlib.tests.features
292
    _test_needs_features = [features.UnicodeFilenameFeature]
5013.2.3 by Vincent Ladeuil
Simplify some tests in per_workingtree/test_smart_add.py.
293
294
    def setUp(self):
295
        super(TestSmartAddTreeUnicode, self).setUp()
296
        self.build_tree([u'a\u030a'])
2568.2.4 by Robert Collins
* ``bzrlib.add.smart_add`` and ``bzrlib.add.smart_add_tree`` are now
297
        self.wt = self.make_branch_and_tree('.')
5013.2.3 by Vincent Ladeuil
Simplify some tests in per_workingtree/test_smart_add.py.
298
        self.overrideAttr(osutils, 'normalized_filename')
2568.2.4 by Robert Collins
* ``bzrlib.add.smart_add`` and ``bzrlib.add.smart_add_tree`` are now
299
5868.1.4 by Andrew Bennetts
Tweak mgz's patch to preserve the test coverage of raising NoSuchFile if unnormalized unicode is passed to a wt format that requires normalized unicode.
300
    def test_requires_normalized_unicode_filenames_fails_on_unnormalized(self):
301
        """Adding unnormalized unicode filenames fail if and only if the
302
        workingtree format has the requires_normalized_unicode_filenames flag
5929.1.1 by Vincent Ladeuil
Fix spurious test failure on OSX for WorkingTreeFormat2
303
        set and the underlying filesystem doesn't normalize.
5868.1.4 by Andrew Bennetts
Tweak mgz's patch to preserve the test coverage of raising NoSuchFile if unnormalized unicode is passed to a wt format that requires normalized unicode.
304
        """
305
        osutils.normalized_filename = osutils._accessible_normalized_filename
5929.1.1 by Vincent Ladeuil
Fix spurious test failure on OSX for WorkingTreeFormat2
306
        if (self.workingtree_format.requires_normalized_unicode_filenames
307
            and sys.platform != 'darwin'):
5868.1.4 by Andrew Bennetts
Tweak mgz's patch to preserve the test coverage of raising NoSuchFile if unnormalized unicode is passed to a wt format that requires normalized unicode.
308
            self.assertRaises(
309
                errors.NoSuchFile, self.wt.smart_add, [u'a\u030a'])
310
        else:
311
            self.wt.smart_add([u'a\u030a'])
312
2568.2.4 by Robert Collins
* ``bzrlib.add.smart_add`` and ``bzrlib.add.smart_add_tree`` are now
313
    def test_accessible_explicit(self):
314
        osutils.normalized_filename = osutils._accessible_normalized_filename
5582.10.29 by Jelmer Vernooij
Add requires_normalized_unicode_filenames
315
        if self.workingtree_format.requires_normalized_unicode_filenames:
5868.1.4 by Andrew Bennetts
Tweak mgz's patch to preserve the test coverage of raising NoSuchFile if unnormalized unicode is passed to a wt format that requires normalized unicode.
316
            raise tests.TestNotApplicable(
317
                'Working tree format smart_add requires normalized unicode '
318
                'filenames')
5868.1.1 by Martin
Turn two long-standing unexpected successes into skips
319
        self.wt.smart_add([u'a\u030a'])
5013.2.3 by Vincent Ladeuil
Simplify some tests in per_workingtree/test_smart_add.py.
320
        self.wt.lock_read()
321
        self.addCleanup(self.wt.unlock)
322
        self.assertEqual([('', 'directory'), (u'\xe5', 'file')],
323
                         [(path, ie.kind) for path,ie in
5807.1.8 by Jelmer Vernooij
Fix some tests.
324
                          self.wt.iter_entries_by_dir()])
2568.2.4 by Robert Collins
* ``bzrlib.add.smart_add`` and ``bzrlib.add.smart_add_tree`` are now
325
326
    def test_accessible_implicit(self):
327
        osutils.normalized_filename = osutils._accessible_normalized_filename
5582.10.29 by Jelmer Vernooij
Add requires_normalized_unicode_filenames
328
        if self.workingtree_format.requires_normalized_unicode_filenames:
5868.1.4 by Andrew Bennetts
Tweak mgz's patch to preserve the test coverage of raising NoSuchFile if unnormalized unicode is passed to a wt format that requires normalized unicode.
329
            raise tests.TestNotApplicable(
330
                'Working tree format smart_add requires normalized unicode '
331
                'filenames')
5868.1.1 by Martin
Turn two long-standing unexpected successes into skips
332
        self.wt.smart_add([])
5013.2.3 by Vincent Ladeuil
Simplify some tests in per_workingtree/test_smart_add.py.
333
        self.wt.lock_read()
334
        self.addCleanup(self.wt.unlock)
335
        self.assertEqual([('', 'directory'), (u'\xe5', 'file')],
5013.2.6 by Vincent Ladeuil
WorkingTreeFormat2 don't support not normalized filenames.
336
                         [(path, ie.kind) for path,ie
5807.1.8 by Jelmer Vernooij
Fix some tests.
337
                          in self.wt.iter_entries_by_dir()])
2568.2.4 by Robert Collins
* ``bzrlib.add.smart_add`` and ``bzrlib.add.smart_add_tree`` are now
338
339
    def test_inaccessible_explicit(self):
340
        osutils.normalized_filename = osutils._inaccessible_normalized_filename
5013.2.3 by Vincent Ladeuil
Simplify some tests in per_workingtree/test_smart_add.py.
341
        self.assertRaises(errors.InvalidNormalization,
342
                          self.wt.smart_add, [u'a\u030a'])
2568.2.4 by Robert Collins
* ``bzrlib.add.smart_add`` and ``bzrlib.add.smart_add_tree`` are now
343
344
    def test_inaccessible_implicit(self):
345
        osutils.normalized_filename = osutils._inaccessible_normalized_filename
5013.2.3 by Vincent Ladeuil
Simplify some tests in per_workingtree/test_smart_add.py.
346
        # TODO: jam 20060701 In the future, this should probably
347
        #       just ignore files that don't fit the normalization
348
        #       rules, rather than exploding
349
        self.assertRaises(errors.InvalidNormalization, self.wt.smart_add, [])