#NEWLINE# @ patch ( 'subprocess.Popen' ) #NEWLINE# def test_digilent_adept_with_http( self , Popen ) : #NEWLINE# #INDENT# popen = Popen . return_value #NEWLINE# popen . wait . return_value = 0 #NEWLINE# popen . communicate . return_value = ( '' , '' ) #NEWLINE# self . cfg_manager . _set_value ( 'xilinx_device_to_program' , 'DigilentAdept' ) #NEWLINE# self . cfg_manager . _set_value ( 'xilinx_device_to_send_commands' , 'HttpDevice' ) #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_send = 1 #NEWLINE# self . assertEquals ( self , len ( self . uxm . _command_sender . _http_device . msgs ) ) #NEWLINE# self . uxm . do_send_command_to_device ( 'ClockActivation off, ClockActivation on 1500, SetPulse on 3' ) #NEWLINE# self . assertEquals ( ( 1 + initial_send ) , len ( self . uxm . _command_sender . _http_device . msgs ) ) #NEWLINE# self . assertEquals ( 'ClockActivation off, ClockActivation on 1500, SetPulse on 3' , self . uxm . _command_sender . _http_device . msgs [ ( 0 + initial_send ) ] )