'If a certificate in the directory is unreadable,
L{endpoints._loadCAsFromDir} will ignore that certificate.'

def test_unreadableCertificate(self):

    class UnreadableFilePath(FilePath, ):
        def getContent(self):
            data = FilePath.getContent(self)
            if (data == casPath.child('thing2.pem').getContent()):
                raise IOError(EPERM)
            else:
                return data
    casPathClone = casPath.child('ignored').parent()
    casPathClone.clonePath = UnreadableFilePath
    self.assertEqual([Certificate(x) for x in endpoints._loadCAsFromDir(casPathClone)._caCerts], [Certificate.loadPEM(casPath.child('thing1.pem').getContent())])
