'If after a response is done the {HTTP11ClientProtocol} returns a
C{Connection: close} header in the response, the C{quiescentCallback}
is not called and the connection is lost.'

def test_quiescentCallbackNotCalled(self):

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