'Tests listing directories.'

def testListDirectory(self):

    p = rdf_paths.PathSpec(path=self.base_path, pathtype=0)
    results = self.RunAction(standard.ListDirectory, rdf_client.ListDirRequest(pathspec=p))
    result = None
    for result in results:
        if (os.path.basename(result.pathspec.path) == 'morenumbers.txt'):
            break
    self.assertTrue(result)
    self.assertEqual(result.__class__, rdf_client.StatEntry)
    self.assertEqual(result.pathspec.Basename(), 'morenumbers.txt')
    self.assertEqual(result.st_size, 3893)
    self.assertTrue(stat.S_ISREG(result.st_mode))
