#NEWLINE# def test_mock_transfer_encoding_chunked( self ) : #NEWLINE# #INDENT# stream = [ b'fo' , b'o' , b'bar' ] #NEWLINE# fp = MockChunkedEncodingResponse ( stream ) #NEWLINE# r = httplib . HTTPResponse ( MockSock ) #NEWLINE# r . fp = fp #NEWLINE# resp = HTTPResponse ( r , preload_content = False , headers = { #NEWLINE# #INDENT# 'transfer-encoding' : 'chunked' , #NEWLINE# #UNINDENT# } ) #NEWLINE# i = 0 #NEWLINE# for c in resp . stream ( ) : #NEWLINE# #INDENT# self . assertEqual ( c , stream [ i ] ) #NEWLINE# i += 1