'If L{Request} is created with a C{bodyProducer} with a known length and
the producer tries to produce more than than many bytes, the
L{Deferred} returned by L{Request.writeTo} fires with a L{Failure}
wrapping a L{WrongBodyLength} exception.'

def test_sendRequestBodyErrorWithTooManyBytes(self):

    def finisher(producer):
        producer.finished.errback(ArbitraryException())
        errors = self.flushLoggedErrors(ArbitraryException)
        self.assertEqual(len(errors), 1)
    return self._sendRequestBodyWithTooManyBytesTest(finisher)
