#NEWLINE# def test_sendRequestBodyErrorWithConsumerError( self ) : #NEWLINE# #INDENT# "\n        Though there should be no way for the internal C{finishedConsuming}\n        L{Deferred} in L{Request._writeToContentLength} to fire a L{Failure}\n        after the C{finishedProducing} L{Deferred} has fired, in case this does\n        happen, the error should be logged with a message about how there's\n        probably a bug in L{Request}.\n\n        This is a whitebox test.\n        " #NEWLINE# producer = StringProducer ( 3 ) #NEWLINE# request = Request ( b'POST' , b'/bar' , _boringHeaders , producer ) #NEWLINE# request . writeTo ( self . transport ) #NEWLINE# finishedConsuming = producer . consumer . _finished #NEWLINE# producer . consumer . write ( b'abc' ) #NEWLINE# producer . finished . callback ( None ) #NEWLINE# finishedConsuming . errback ( ArbitraryException ( ) ) #NEWLINE# self . assertEqual ( len ( self . flushLoggedErrors ( ArbitraryException ) ) , 1 )