#NEWLINE# def test_zeroContentLength( self ) : #NEWLINE# #INDENT# '\n        If a response includes a I{Content-Length} header indicating zero bytes\n        in the response, L{Response.length} is set accordingly and no data is\n        delivered to L{Response._bodyDataReceived}.\n        ' #NEWLINE# finished = [ ] #NEWLINE# protocol = HTTPClientParser ( Request ( b'GET' , b'/' , _boringHeaders , None ) , finished . append ) #NEWLINE# protocol . makeConnection ( StringTransport ( ) ) #NEWLINE# protocol . dataReceived ( b'HTTP/1.1 200 OK\r\n' ) #NEWLINE# body = [ ] #NEWLINE# protocol . response . _bodyDataReceived = body . append #NEWLINE# protocol . dataReceived ( b'Content-Length: 0\r\n' ) #NEWLINE# protocol . dataReceived ( b'\r\n' ) #NEWLINE# self . assertEqual ( body . state , DONE ) #NEWLINE# self . assertEqual ( body , [ ] ) #NEWLINE# self . assertEqual ( finished , [ b'' ] ) #NEWLINE# self . assertEqual ( protocol . response . length , 0 )