'pyOpenSSL isn\'t always so great about reporting errors.  If one occurs
in the verification info callback, it should be logged and the
connection should be shut down (if possible, anyway; the app_data could
be clobbered but there\'s no point testing for that).'

def test_surpriseFromInfoCallback(self):

    (cProto, sProto, pump) = self.serviceIdentitySetup(u'correct-host.example.com', u'correct-host.example.com', buggyInfoCallback=True)
    self.assertEqual(cProto.wrappedProtocol.data, '')
    self.assertEqual(sProto.wrappedProtocol.data, '')
    cErr = cProto.wrappedProtocol.lostReason.value
    sErr = sProto.wrappedProtocol.lostReason.value
    self.assertIsInstance(cErr, ZeroDivisionError)
    self.assertIsInstance(sErr, (ConnectionClosed, SSL.Error))
    errors = self.flushLoggedErrors(ZeroDivisionError)
    self.assertTrue(errors)
