def testLateRequester(self): medium = self.get_local('medium') agent = self.get_local('agent') recip = IRecipient(agent) requester = agent.initiate_protocol(LateRequester, recip) d = requester.notify_finish() self.assertFailure(d, protocols.ProtocolExpired) yield d yield agent.callback_event("late event", None) self.assertCalled(agent, 'called', times=0)
def on_restarted(self, agent): agent.callback_event('shard_agent_restarted', self.recipient)