#NEWLINE# def test_initial_settings( self , frame_buffer ) : #NEWLINE# #INDENT# self . set_up ( ) #NEWLINE# data = [ ] #NEWLINE# send_event = threading . Event ( ) #NEWLINE# def socket_handler( listener ) : #NEWLINE# #INDENT# sock = listener . accept ( ) [ 0 ] #NEWLINE# first = sock . recv ( 65535 ) #NEWLINE# data . append ( first ) #NEWLINE# f = SettingsFrame ( 0 ) #NEWLINE# sock . send ( f . serialize ( ) ) #NEWLINE# send_event . set ( ) #NEWLINE# sock . close ( ) #NEWLINE# #UNINDENT# self . _start_server ( socket_handler ) #NEWLINE# conn = self . get_connection ( ) #NEWLINE# conn . connect ( ) #NEWLINE# send_event . wait ( ) #NEWLINE# preamble_size = len ( b'PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n' ) #NEWLINE# data = data [ 0 ] [ preamble_size : ] #NEWLINE# frame_buffer . add_data ( data ) #NEWLINE# frames = list ( frame_buffer ) #NEWLINE# f = frames [ 1 ] #NEWLINE# assert isinstance ( f , SettingsFrame ) #NEWLINE# assert ( f . stream_id == 0 ) #NEWLINE# assert ( f . settings == { #NEWLINE# #INDENT# SettingsFrame . ENABLE_PUSH : 0 , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . tear_down ( )