#NEWLINE# def test_no_body( self ) : #NEWLINE# #INDENT# req = b'GET / HTTP/1.1\r\nContent-Type: text/html\r\n\r\n' #NEWLINE# transport = unittest . mock . Mock ( ) #NEWLINE# transport . get_extra_info . return_value = ( '127.0.0.1' , 1 ) #NEWLINE# stream = asyncio . StreamReader ( loop = self . loop ) #NEWLINE# stream . set_transport ( transport ) #NEWLINE# task = asyncio . Task ( HttpParser . parse ( stream ) , loop = self . loop ) #NEWLINE# self . loop . call_soon ( ( lambda : stream . feed_data ( req ) ) ) #NEWLINE# result = self . loop . run_until_complete ( task ) #NEWLINE# body = self . loop . run_until_complete ( asyncio . Task ( result . body . read ( ) , loop = self . loop ) ) #NEWLINE# self . assertEqual ( body , b'' )