'Verify that if the body producer fires its Deferred and then keeps
writing to the consumer that the extra writes are ignored and the
L{Deferred} returned by L{Request.writeTo} fires with a L{Failure}
wrapping the most appropriate exception type.'

def _sendRequestBodyFinishedEarlyThenTooManyBytes(self, finisher):

    producer = StringProducer(3)
    request = Request('POST', '/bar', _boringHeaders, producer)
    writeDeferred = request.writeTo(self.transport)
    producer.consumer.write('ab')
    finisher(producer)
    self.assertIdentical(self.transport.producer, None)
    self.transport.clear()
    self.assertRaises(ExcessWrite, producer.consumer.write, 'cd')
    self.assertEqual(self.transport.value(), '')
    return writeDeferred
