~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_smart_add.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-07-12 15:20:38 UTC
  • mfrom: (1850.2.2 fix-add)
  • Revision ID: pqm@pqm.ubuntu.com-20060712152038-043e16bab49a5b50
(jam) smart-add should recurse all supplied directories (bug #52578)

Show diffs side-by-side

added added

removed removed

Lines of Context:
191
191
        for path in paths:
192
192
            self.assertNotEqual(wt.path2id(path), None)
193
193
 
 
194
    def test_add_multiple_dirs(self):
 
195
        """Test smart adding multiple directories at once."""
 
196
        added_paths = ['file1', 'file2',
 
197
                       'dir1/', 'dir1/file3',
 
198
                       'dir1/subdir2/', 'dir1/subdir2/file4',
 
199
                       'dir2/', 'dir2/file5',
 
200
                      ]
 
201
        not_added = ['file6', 'dir3/', 'dir3/file7', 'dir3/file8']
 
202
        self.build_tree(added_paths)
 
203
        self.build_tree(not_added)
 
204
 
 
205
        wt = self.make_branch_and_tree('.')
 
206
        smart_add_tree(wt, ['file1', 'file2', 'dir1', 'dir2'])
 
207
 
 
208
        for path in added_paths:
 
209
            self.assertNotEqual(None, wt.path2id(path.rstrip('/')),
 
210
                    'Failed to add path: %s' % (path,))
 
211
        for path in not_added:
 
212
            self.assertEqual(None, wt.path2id(path.rstrip('/')),
 
213
                    'Accidentally added path: %s' % (path,))
 
214
 
194
215
 
195
216
class TestAddNonNormalized(TestCaseWithTransport):
196
217