#NEWLINE# def test_new_worker_socks( self ) : #NEWLINE# #INDENT# self . strategy . bind_ports ( ) #NEWLINE# pid = 88 #NEWLINE# sock_count = 0 #NEWLINE# for ( s , i ) in self . strategy . new_worker_socks ( ) : #NEWLINE# #INDENT# self . assertEqual ( 'abc' , s ) #NEWLINE# self . assertIsNone ( i ) #NEWLINE# self . strategy . register_worker_start ( s , 'unused' , pid ) #NEWLINE# pid += 1 #NEWLINE# sock_count += 1 #NEWLINE# #UNINDENT# self . assertEqual ( [ ( 'Started child %s' % 88 ) , ( 'Started child %s' % 89 ) ] , self . logger . get_lines_for_level ( 'notice' ) ) #NEWLINE# self . assertEqual ( 2 , s ) #NEWLINE# self . assertEqual ( [ ] , list ( self . strategy . new_worker_socks ( ) ) ) #NEWLINE# sock_count = 0 #NEWLINE# self . strategy . register_worker_exit ( 88 ) #NEWLINE# self . assertEqual ( [ ( 'Removing dead child %s' % 88 ) ] , self . logger . get_lines_for_level ( 'error' ) ) #NEWLINE# for ( s , i ) in self . strategy . new_worker_socks ( ) : #NEWLINE# #INDENT# self . assertEqual ( 'abc' , s ) #NEWLINE# self . assertIsNone ( i ) #NEWLINE# self . strategy . register_worker_start ( s , 'unused' , pid ) #NEWLINE# pid += 1 #NEWLINE# sock_count += 1 #NEWLINE# #UNINDENT# self . assertEqual ( 1 , sock_count ) #NEWLINE# self . assertEqual ( [ ( 'Started child %s' % 88 ) , ( 'Started child %s' % 89 ) , ( 'Started child %s' % 90 ) ] , self . logger . get_lines_for_level ( 'notice' ) )