#NEWLINE# @ pytest . mark . parametrize ( 'headers' , ( example_request_headers , bytes_example_request_headers ) ) #NEWLINE# @ pytest . mark . parametrize ( 'cookie_header' , secured_cookie_headers ) #NEWLINE# def test_short_cookie_headers_never_indexed_push( self , headers , cookie_header , frame_factory ) : #NEWLINE# #INDENT# '\n        Short cookie headers, and cookies provided as NeverIndexedHeaderTuple,\n        are never indexed when pushed by servers.\n        ' #NEWLINE# send_headers = ( headers + [ cookie_header ] ) #NEWLINE# expected_headers = ( headers + [ NeverIndexedHeaderTuple ( cookie_header [ 0 ] . lower ( ) , cookie_header [ 1 ] ) ] ) #NEWLINE# c = h2 . connection . H2Connection ( client_side = False ) #NEWLINE# c . receive_data ( frame_factory . preamble ( ) ) #NEWLINE# f = frame_factory . build_headers_frame ( self . example_request_headers ) #NEWLINE# c . receive_data ( f . serialize ( ) ) #NEWLINE# frame_factory . refresh_encoder ( ) #NEWLINE# expected_frame = frame_factory . build_push_promise_frame ( stream_id = 1 , promised_stream_id = 2 , headers = expected_headers , flags = [ 'END_HEADERS' ] ) #NEWLINE# c . clear_outbound_data_buffer ( ) #NEWLINE# c . push_stream ( stream_id = 1 , promised_stream_id = 2 , request_headers = send_headers ) #NEWLINE# assert ( c . data_to_send ( ) == expected_frame . serialize ( ) )