'Test our ability to walk over a directory tree.'

def testRecursiveListNames(self):

    path = os.path.join(self.base_path, 'a')
    directory = vfs.VFSOpen(rdf_paths.PathSpec(path=path, pathtype=rdf_paths.PathSpec.PathType.OS))
    self.assertEqual(directory._GetDepth('/'), 0)
    self.assertEqual(directory._GetDepth('/foo/bar/baz'), 3)
    with self.assertRaises(RuntimeError):
        directory._GetDepth('foo/bar')
    self.assertEqual(directory._GetDepth('/////foo///bar//////baz//'), 3)
    walk_tups_0 = list(directory.RecursiveListNames())
    walk_tups_1 = list(directory.RecursiveListNames(depth=1))
    walk_tups_2 = list(directory.RecursiveListNames(depth=2))
    walk_tups_inf = list(directory.RecursiveListNames(depth=float('inf')))
    self.assertEqual(walk_tups_0, [(path, ['b'], [])])
    self.assertEqual(walk_tups_1, [(path, ['b'], []), (('%s/b' % path), ['c', 'd'], [])])
    self.assertEqual(walk_tups_2, [(path, ['b'], []), (('%s/b' % path), ['c', 'd'], []), (('%s/b/c' % path), [], ['helloc.txt']), (('%s/b/d' % path), [], ['hellod.txt'])])
    self.assertEqual(walk_tups_inf, [(path, ['b'], []), (('%s/b' % path), ['c', 'd'], []), (('%s/b/c' % path), [], ['helloc.txt']), (('%s/b/d' % path), [], ['hellod.txt'])])
