#NEWLINE# @ gen . engine #NEWLINE# def run_tests( ) : #NEWLINE# #INDENT# url = ( options . url + '/getCaseCount' ) #NEWLINE# control_ws = ( yield websocket_connect ( url , None ) ) #NEWLINE# num_tests = int ( ( yield control_ws . read_message ( ) ) ) #NEWLINE# logging . info ( 'running %d cases' , num_tests ) #NEWLINE# msg = ( yield control_ws . read_message ( ) ) #NEWLINE# assert ( msg is None ) #NEWLINE# for i in range ( 1 , ( num_tests + 1 ) ) : #NEWLINE# #INDENT# logging . info ( 'running test case %d' , i ) #NEWLINE# url = ( options . url + ( '/runCase?case=%d&agent=%s' % ( i , options . name ) ) ) #NEWLINE# test_ws = ( yield websocket_connect ( url , None , compression_options = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) ) #NEWLINE# while True : #NEWLINE# #INDENT# message = ( yield test_ws . read_message ( ) ) #NEWLINE# if ( message is None ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# test_ws . write_message ( message , binary = isinstance ( message , bytes ) ) #NEWLINE# #UNINDENT# #UNINDENT# url = ( options . url + ( '/updateReports?agent=%s' % options . name ) ) #NEWLINE# update_ws = ( yield websocket_connect ( url , None ) ) #NEWLINE# msg = ( yield update_ws . read_message ( ) ) #NEWLINE# assert ( msg is None ) #NEWLINE# IOLoop . instance ( ) . stop ( )