'If C{quiescentCallback} throws an exception, the error is logged and
protocol is disconnected.'

def test_quiescentCallbackThrows(self):

    def callback(p):
        raise ZeroDivisionError()
    transport = StringTransport()
    protocol = HTTP11ClientProtocol(callback)
    protocol.makeConnection(transport)
    requestDeferred = protocol.request(Request('GET', '/', _boringHeaders, None, persistent=True))
    protocol.dataReceived('HTTP/1.1    200    OK\r\nContent-length:    0\r\n\r\n')
    result = []
    requestDeferred.addCallback(result.append)
    response = result[0]
    bodyProtocol = AccumulatingProtocol()
    response.deliverBody(bodyProtocol)
    bodyProtocol.closedReason.trap(ResponseDone)
    errors = self.flushLoggedErrors(ZeroDivisionError)
    self.assertEqual(len(errors), 1)
    self.assertTrue(transport.disconnecting)
