#NEWLINE# def _async_delayed( self , method , url , body , headers ) : #NEWLINE# #INDENT# global async_delay #NEWLINE# query = self . _check_request ( url ) #NEWLINE# if ( query [ 'command' ] . lower ( ) == 'queryasyncjobresult' ) : #NEWLINE# #INDENT# self . assertEqual ( query [ 'jobid' ] , '42' ) #NEWLINE# if ( async_delay == 0 ) : #NEWLINE# #INDENT# result = { #NEWLINE# #INDENT# ( query [ 'command' ] . lower ( ) + 'response' ) : { #NEWLINE# #INDENT# 'jobstatus' : 1 , #NEWLINE# 'jobresult' : { #NEWLINE# #INDENT# 'fake' : 'result' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# result = { #NEWLINE# #INDENT# ( query [ 'command' ] . lower ( ) + 'response' ) : { #NEWLINE# #INDENT# 'jobstatus' : 0 , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# async_delay -= 1 #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# result = { #NEWLINE# #INDENT# ( query [ 'command' ] . lower ( ) + 'response' ) : { #NEWLINE# #INDENT# 'jobid' : '42' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# return self . _response ( httplib . OK , result , httplib . responses [ httplib . OK ] )