'If L{Request.writeTo} raises an exception,
L{HTTP11ClientProtocol.request} returns a L{Deferred} which fires with
a L{Failure} of L{RequestGenerationFailed} wrapping that exception.'

def test_synchronousWriteToError(self):

    class BrokenRequest:
        persistent = False
        def writeTo(self, transport):
            raise ArbitraryException()
    d = self.protocol.request(BrokenRequest())
    return assertRequestGenerationFailed(self, d, [ArbitraryException])
