#NEWLINE# def _noBodyTest( self , request , status , response ) : #NEWLINE# #INDENT# '\n        Assert that L{HTTPClientParser} parses the given C{response} to\n        C{request}, resulting in a response with no body and no extra bytes and\n        leaving the transport in the producing state.\n\n        @param request: A L{Request} instance which might have caused a server\n            to return the given response.\n        @param status: A string giving the status line of the response to be\n            parsed.\n        @param response: A string giving the response to be parsed.\n\n        @return: A C{dict} of headers from the response.\n        ' #NEWLINE# header = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# finished = [ ] #NEWLINE# body = [ ] #NEWLINE# bodyDataFinished = [ ] #NEWLINE# protocol = HTTPClientParser ( request , finished . append ) #NEWLINE# protocol . headerReceived = header . __setitem__ #NEWLINE# transport = StringTransport ( ) #NEWLINE# protocol . makeConnection ( transport ) #NEWLINE# protocol . dataReceived ( status ) #NEWLINE# protocol . response . _bodyDataReceived = body . append #NEWLINE# protocol . response . _bodyDataFinished = ( lambda : bodyDataFinished . append ( True ) ) #NEWLINE# protocol . dataReceived ( response ) #NEWLINE# self . assertEqual ( transport . producerState , 'producing' ) #NEWLINE# self . assertEqual ( protocol . state , DONE ) #NEWLINE# self . assertEqual ( body , [ ] ) #NEWLINE# self . assertEqual ( finished , [ b'' ] ) #NEWLINE# self . assertEqual ( bodyDataFinished , [ True ] ) #NEWLINE# self . assertEqual ( protocol . response . length , 0 ) #NEWLINE# return header