#NEWLINE# def run_handler( records , role = FCGI_RESPONDER , request_handler = None , capabilities = None , timeout = None ) : #NEWLINE# #INDENT# conn = mock . MagicMock ( ) #NEWLINE# conn . __iter__ . return_value = iter_records ( records ) #NEWLINE# if ( capabilities is None ) : #NEWLINE# #INDENT# capabilities = { #NEWLINE# #INDENT# FCGI_MAX_CONNS : '1' , #NEWLINE# FCGI_MAX_REQS : '1' , #NEWLINE# FCGI_MPXS_CONNS : '0' , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# if ( request_handler is None ) : #NEWLINE# #INDENT# request_handler = mock . MagicMock ( ) #NEWLINE# #UNINDENT# handler = ConnectionHandler ( conn , role , capabilities , conn ) #NEWLINE# g = spawn ( handler . run ) #NEWLINE# g . join ( timeout ) #NEWLINE# return handler