#NEWLINE# def test_xilinx_with_serial_port( self ) : #NEWLINE# #INDENT# self . cfg_manager . _set_value ( 'xilinx_device_to_program' , 'XilinxImpact' ) #NEWLINE# self . cfg_manager . _set_value ( 'xilinx_device_to_send_commands' , 'SerialPort' ) #NEWLINE# self . uxm = UdXilinxExperiment . UdXilinxExperiment ( None , None , self . cfg_manager ) #NEWLINE# self . uxm . do_send_file_to_device ( ExperimentUtil . serialize ( ( 'whatever ' * 400 ) ) , 'program' ) #NEWLINE# self . wait_for_programming_to_end ( ) #NEWLINE# initial_open = 1 #NEWLINE# initial_send = 1 #NEWLINE# initial_close = 1 #NEWLINE# self . assertEquals ( initial_open , self . uxm . _command_sender . _serial_port . dict [ 'open' ] ) #NEWLINE# self . assertEquals ( initial_close , self . uxm . _command_sender . _serial_port . dict [ 'close' ] ) #NEWLINE# self . assertEquals ( initial_send , self . uxm . _command_sender . _serial_port . dict [ 'send' ] ) #NEWLINE# self . assertEquals ( initial_send , len ( self . uxm . _command_sender . _serial_port . codes ) ) #NEWLINE# self . uxm . do_send_command_to_device ( 'ClockActivation off, ClockActivation on 1500, SetPulse on 3' ) #NEWLINE# self . assertEquals ( ( 1 + initial_close ) , self . uxm . _command_sender . _serial_port . dict [ 'open' ] ) #NEWLINE# self . assertEquals ( ( 1 + initial_close ) , self . uxm . _command_sender . _serial_port . dict [ 'close' ] ) #NEWLINE# self . assertEquals ( ( 3 + initial_send ) , self . uxm . _command_sender . _serial_port . dict [ 'send' ] ) #NEWLINE# self . assertEquals ( ( 3 + initial_send ) , len ( self . uxm . _command_sender . _serial_port . codes ) ) #NEWLINE# self . assertEquals ( 37 , self . uxm . _command_sender . _serial_port . codes [ ( 0 + initial_send ) ] ) #NEWLINE# self . assertEquals ( 35 , self . uxm . _command_sender . _serial_port . codes [ ( 1 + initial_send ) ] ) #NEWLINE# self . assertEquals ( 27 , self . uxm . _command_sender . _serial_port . codes [ ( 2 + initial_send ) ] )