~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_osutils.py

merge bzr.dev.revno.1905

Show diffs side-by-side

added added

removed removed

Lines of Context:
307
307
            ]
308
308
        self.build_tree(tree)
309
309
        expected_dirblocks = [
310
 
                [
311
 
                    ('0file', '0file', 'file'),
312
 
                    ('1dir', '1dir', 'directory'),
313
 
                    ('2file', '2file', 'file'),
314
 
                ],
315
 
                [
316
 
                    ('1dir/0file', '0file', 'file'),
317
 
                    ('1dir/1dir', '1dir', 'directory'),
318
 
                ],
319
 
                [
320
 
                ],
 
310
                (('', '.'),
 
311
                 [('0file', '0file', 'file'),
 
312
                  ('1dir', '1dir', 'directory'),
 
313
                  ('2file', '2file', 'file'),
 
314
                 ]
 
315
                ),
 
316
                (('1dir', './1dir'),
 
317
                 [('1dir/0file', '0file', 'file'),
 
318
                  ('1dir/1dir', '1dir', 'directory'),
 
319
                 ]
 
320
                ),
 
321
                (('1dir/1dir', './1dir/1dir'),
 
322
                 [
 
323
                 ]
 
324
                ),
321
325
            ]
322
326
        result = []
323
327
        found_bzrdir = False
324
 
        for dirblock in osutils.walkdirs('.'):
 
328
        for dirdetail, dirblock in osutils.walkdirs('.'):
325
329
            if len(dirblock) and dirblock[0][1] == '.bzr':
326
330
                # this tests the filtering of selected paths
327
331
                found_bzrdir = True
328
332
                del dirblock[0]
329
 
            result.append(dirblock)
 
333
            result.append((dirdetail, dirblock))
330
334
 
331
335
        self.assertTrue(found_bzrdir)
332
336
        self.assertEqual(expected_dirblocks,
333
 
            [[line[0:3] for line in block] for block in result])
 
337
            [(dirinfo, [line[0:3] for line in block]) for dirinfo, block in result])
334
338
        # you can search a subdir only, with a supplied prefix.
335
339
        result = []
336
 
        for dirblock in osutils.walkdirs('1dir', '1dir'):
 
340
        for dirblock in osutils.walkdirs('./1dir', '1dir'):
337
341
            result.append(dirblock)
338
342
        self.assertEqual(expected_dirblocks[1:],
339
 
            [[line[0:3] for line in block] for block in result])
 
343
            [(dirinfo, [line[0:3] for line in block]) for dirinfo, block in result])
340
344
 
341
345
    def assertPathCompare(self, path_less, path_greater):
342
346
        """check that path_less and path_greater compare correctly."""