'If the request passed to L{HTTP11ClientProtocol} finished generation
with an error after the L{HTTP11ClientProtocol}\'s connection has been
lost, an error is logged that gives a non-confusing hint to user on what
went wrong.'

def test_errorMessageOnConnectionLostBeforeGenerationFailedDoesNotConfuse(self):

    errors = []
    log.addObserver(errors.append)
    self.addCleanup(log.removeObserver, errors.append)
    def check(ignore):
        error = errors[0]
        self.assertEqual(error[u'why'], u'Error    writing    request,    but    not    in    valid    state    to    finalize    request:    CONNECTION_LOST')
    return self.test_connectionLostDuringRequestGeneration('errback').addCallback(check)
