#NEWLINE# @ classmethod #NEWLINE# def setUpClass( self ) : #NEWLINE# #INDENT# shutil . rmtree ( './data/tests' , ignore_errors = True ) #NEWLINE# os . makedirs ( './data/tests' ) #NEWLINE# import tests.data_test_webpage #NEWLINE# import httpbin #NEWLINE# self . httpbin_thread = utils . run_in_subprocess ( httpbin . app . run , port = 14887 ) #NEWLINE# self . httpbin = 'http://127.0.0.1:14887' #NEWLINE# ctx = run . cli . make_context ( 'test' , [ '--taskdb' , 'sqlalchemy+sqlite+taskdb:///data/tests/task.db' , '--projectdb' , 'sqlalchemy+sqlite+projectdb:///data/tests/projectdb.db' , '--resultdb' , 'sqlalchemy+sqlite+resultdb:///data/tests/resultdb.db' ] , None , obj = ObjectDict ( testing_mode = True ) ) #NEWLINE# self . ctx = run . cli . invoke ( ctx ) #NEWLINE# self . threads = [ ] #NEWLINE# ctx = run . scheduler . make_context ( 'scheduler' , [ ] , self . ctx ) #NEWLINE# self . scheduler = scheduler = run . scheduler . invoke ( ctx ) #NEWLINE# self . threads . append ( run_in_thread ( scheduler . xmlrpc_run ) ) #NEWLINE# self . threads . append ( run_in_thread ( scheduler . run ) ) #NEWLINE# ctx = run . fetcher . make_context ( 'fetcher' , [ '--xmlrpc' , '--xmlrpc-port' , '24444' ] , self . ctx ) #NEWLINE# fetcher = run . fetcher . invoke ( ctx ) #NEWLINE# self . threads . append ( run_in_thread ( fetcher . xmlrpc_run ) ) #NEWLINE# self . threads . append ( run_in_thread ( fetcher . run ) ) #NEWLINE# ctx = run . processor . make_context ( 'processor' , [ ] , self . ctx ) #NEWLINE# processor = run . processor . invoke ( ctx ) #NEWLINE# self . threads . append ( run_in_thread ( processor . run ) ) #NEWLINE# ctx = run . result_worker . make_context ( 'result_worker' , [ ] , app . ctx ) #NEWLINE# result_worker = run . result_worker . invoke ( ctx ) #NEWLINE# self . threads . append ( run_in_thread ( result_worker . run ) ) #NEWLINE# ctx = run . webui . make_context ( 'webui' , [ '--scheduler-rpc' , 'http://localhost:23333/' ] , self . ctx ) #NEWLINE# app = run . webui . invoke ( ctx ) #NEWLINE# app . debug = True #NEWLINE# self . app = app . test_client ( ) #NEWLINE# self . rpc = app . config [ 'scheduler_rpc' ] #NEWLINE# time . sleep ( 1 )