#NEWLINE# @ tornado . testing . gen_test #NEWLINE# def test_unexisting( self ) : #NEWLINE# #INDENT# ( yield self . start_arbiter ( ) ) #NEWLINE# watcher = self . arbiter . get_watcher ( 'test' ) #NEWLINE# to_kill = [ ] #NEWLINE# nb_proc = len ( watcher . processes ) #NEWLINE# for process in list ( watcher . processes . values ( ) ) : #NEWLINE# #INDENT# to_kill . append ( process . pid ) #NEWLINE# process . stop ( ) #NEWLINE# process . wait ( 3 ) #NEWLINE# self . assertEqual ( process . status , UNEXISTING ) #NEWLINE# #UNINDENT# ( yield watcher . reap_and_manage_processes ( ) ) #NEWLINE# wids = [ p . wid for p in watcher . processes . values ( ) ] #NEWLINE# self . assertEqual ( max ( wids ) , watcher . numprocesses ) #NEWLINE# self . assertEqual ( sum ( nb_proc ) , sum ( range ( 1 , ( watcher . numprocesses + 1 ) ) ) ) #NEWLINE# self . assertEqual ( len ( watcher . processes ) , nb_proc ) #NEWLINE# for p in watcher . processes . values ( ) : #NEWLINE# #INDENT# self . assertFalse ( ( p . pid in to_kill ) ) #NEWLINE# self . assertNotEqual ( p . status , UNEXISTING ) #NEWLINE# #UNINDENT# ( yield self . stop_arbiter ( ) )