~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_smart_add.py

  • Committer: Robert Collins
  • Date: 2006-07-15 14:29:03 UTC
  • mfrom: (1864 +trunk)
  • mto: (1864.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 1865.
  • Revision ID: robertc@robertcollins.net-20060715142903-1ef803f4af9aabc8
Integrate bzr.dev.

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