'If L{HTTPClientParser.connectionLost} is called before the headers are
finished, the C{_responseDeferred} is fired with the L{Failure} passed
to C{connectionLost}.'

def test_connectionLostBeforeBody(self):

    transport = StringTransport()
    protocol = HTTPClientParser(Request('GET', '/', _boringHeaders, None), None)
    protocol.makeConnection(transport)
    responseDeferred = protocol._responseDeferred
    protocol.connectionLost(Failure(ArbitraryException()))
    return assertResponseFailed(self, responseDeferred, [ArbitraryException])
