#NEWLINE# def test_streaming_follow_redirects( self ) : #NEWLINE# #INDENT# headers = [ ] #NEWLINE# chunks = [ ] #NEWLINE# self . fetch ( '/redirect?url=/hello' , header_callback = headers . append , streaming_callback = chunks . append ) #NEWLINE# chunks = list ( map ( to_unicode , chunks ) ) #NEWLINE# self . assertEqual ( chunks , [ 'Hello world!' ] ) #NEWLINE# num_start_lines = len ( [ h for h in headers if h . startswith ( 'HTTP/' ) ] ) #NEWLINE# self . assertEqual ( num_start_lines , 1 )