#NEWLINE# def test_unknownContentLength( self ) : #NEWLINE# #INDENT# '\n        If a response does not include a I{Transfer-Encoding} or a\n        I{Content-Length}, the end of response body is indicated by the\n        connection being closed.\n        ' #NEWLINE# finished = [ ] #NEWLINE# protocol = HTTPClientParser ( Request ( b'GET' , b'/' , _boringHeaders , None ) , finished . append ) #NEWLINE# transport = StringTransport ( ) #NEWLINE# protocol . makeConnection ( transport ) #NEWLINE# protocol . dataReceived ( b'HTTP/1.1 200 OK\r\n' ) #NEWLINE# body = [ ] #NEWLINE# protocol . response . _bodyDataReceived = body . append #NEWLINE# protocol . dataReceived ( b'\r\n' ) #NEWLINE# protocol . dataReceived ( b'foo' ) #NEWLINE# protocol . dataReceived ( b'bar' ) #NEWLINE# self . assertEqual ( body , [ b'foo' , b'bar' ] ) #NEWLINE# protocol . connectionLost ( ConnectionDone ( 'simulated end of connection' ) ) #NEWLINE# self . assertEqual ( finished , [ b'' ] )