#NEWLINE# def test_transportProducingWhenQuiescentAfterFullBody( self ) : #NEWLINE# #INDENT# "\n        The C{quiescentCallback} passed to L{HTTP11ClientProtocol} will only be\n        invoked once that protocol is in a state similar to its initial state.\n        One of the aspects of this initial state is the producer-state of its\n        transport; an L{HTTP11ClientProtocol} begins with a transport that is\n        producing, i.e. not C{pauseProducing}'d.\n\n        Therefore, when C{quiescentCallback} is invoked the protocol will still\n        be producing.\n        " #NEWLINE# quiescentResult = [ ] #NEWLINE# def callback( p ) : #NEWLINE# #INDENT# self . assertEqual ( p , protocol ) #NEWLINE# self . assertEqual ( p . state , 'QUIESCENT' ) #NEWLINE# quiescentResult . append ( p ) #NEWLINE# #UNINDENT# transport = StringTransport ( ) #NEWLINE# protocol = HTTP11ClientProtocol ( callback ) #NEWLINE# protocol . makeConnection ( transport ) #NEWLINE# requestDeferred = protocol . request ( Request ( b'GET' , b'/' , _boringHeaders , None , persistent = True ) ) #NEWLINE# protocol . dataReceived ( b'HTTP/1.1 200 OK\r\nContent-length: 3\r\n\r\nBBB' ) #NEWLINE# response = self . successResultOf ( requestDeferred ) #NEWLINE# self . assertEqual ( response . _state , 'DEFERRED_CLOSE' ) #NEWLINE# self . assertEqual ( len ( quiescentResult ) , 1 ) #NEWLINE# self . assertEqual ( transport . producerState , 'producing' )