#NEWLINE# def _run_wsgi( self , workers = 1 ) : #NEWLINE# #INDENT# 'Start WSGI server with a test application.' #NEWLINE# with mock . patch ( 'neutron.wsgi.WorkerService.start' ) as start_method : #NEWLINE# #INDENT# start_method . side_effect = self . _fake_start #NEWLINE# server = wsgi . Server ( 'Test' ) #NEWLINE# server . start ( self . application , 0 , '0.0.0.0' , workers = workers ) #NEWLINE# self . port = server . port #NEWLINE# os . write ( workers . pipeout , str ( self . port ) ) #NEWLINE# server . wait ( )