#NEWLINE# def test_parallel_flow_with_priority( self ) : #NEWLINE# #INDENT# flow = uf . Flow ( 'p-1' ) #NEWLINE# for i in range ( 0 , 10 ) : #NEWLINE# #INDENT# t = utils . ProgressingTask ( name = ( 'task%s' % self ) ) #NEWLINE# t . priority = i #NEWLINE# flow . add ( t ) #NEWLINE# #UNINDENT# engine = self . _make_engine ( flow ) #NEWLINE# with utils . CaptureListener ( engine , capture_flow = False ) as capturer : #NEWLINE# #INDENT# engine . run ( ) #NEWLINE# #UNINDENT# expected = [ 'task9.t RUNNING' , 'task8.t RUNNING' , 'task7.t RUNNING' , 'task6.t RUNNING' , 'task5.t RUNNING' , 'task4.t RUNNING' , 'task3.t RUNNING' , 'task2.t RUNNING' , 'task1.t RUNNING' , 'task0.t RUNNING' ] #NEWLINE# gotten = capturer . values [ 0 : 10 ] #NEWLINE# self . assertEqual ( expected , gotten )