#NEWLINE# def testHuntClientRateWithPause( self ) : #NEWLINE# #INDENT# 'Check that clients are scheduled only if the hunt is running.' #NEWLINE# start_time = 10 #NEWLINE# client_ids = self . SetupClients ( 10 ) #NEWLINE# with test_lib . FakeTime ( start_time ) : #NEWLINE# #INDENT# ( worker_mock , hunt_urn ) = self . _RunRateLimitedHunt ( client_ids , start_time ) #NEWLINE# with aff4 . FACTORY . Open ( hunt_obj , age = aff4 . ALL_TIMES , mode = 'rw' , token = self . token ) as hunt_obj : #NEWLINE# #INDENT# hunt_obj . Stop ( ) #NEWLINE# #UNINDENT# for i in range ( len ( client_ids ) ) : #NEWLINE# #INDENT# with test_lib . FakeTime ( ( ( start_time + 1 ) + ( 60 * i ) ) ) : #NEWLINE# #INDENT# worker_mock . Simulate ( ) #NEWLINE# #UNINDENT# #UNINDENT# self . assertEqual ( len ( DummyHunt . client_ids ) , 1 )