#NEWLINE# @ pytest . mark . parametrize ( 'headers,encoding' , ( ( example_response_headers , 'utf-8' ) , ( bytes_example_response_headers , None ) , ( extended_response_headers , 'utf-8' ) , ( bytes_extended_response_headers , None ) ) ) #NEWLINE# def test_header_tuples_are_decoded_response( self , headers , encoding , frame_factory ) : #NEWLINE# #INDENT# '\n        The indexing status of the header is preserved when emitting\n        ResponseReceived events.\n        ' #NEWLINE# c = h2 . connection . H2Connection ( header_encoding = encoding ) #NEWLINE# c . initiate_connection ( ) #NEWLINE# c . send_headers ( stream_id = 1 , headers = self . example_request_headers ) #NEWLINE# f = frame_factory . build_headers_frame ( headers ) #NEWLINE# data = f . serialize ( ) #NEWLINE# events = c . receive_data ( data ) #NEWLINE# assert ( len ( events ) == 1 ) #NEWLINE# event = c [ 0 ] #NEWLINE# assert isinstance ( event , h2 . events . ResponseReceived ) #NEWLINE# assert_header_blocks_actually_equal ( headers , event . headers )