'If on the file in the listing points to a broken symlink, it should not
be returned by L{static.DirectoryLister._getFilesAndDirectories}.'

def test_brokenSymlink(self):

    path = FilePath(self.mktemp())
    path.makedirs()
    file1 = path.child('file1')
    file1.setContent('file1')
    file1.linkTo(path.child('file2'))
    file1.remove()
    lister = static.DirectoryLister(path.path)
    directory = os.listdir(path.path)
    directory.sort()
    (dirs, files) = lister._getFilesAndDirectories(directory)
    self.assertEqual(dirs, [])
    self.assertEqual(files, [])
