def wait_agency_for_idle(self, agency, timeout, freq=0.5): try: check = lambda: self.is_agency_idle(agency) yield self.wait_for(check, timeout, freq) except unittest.FailTest: for agent in agency.get_agents(): activity = agent.show_activity() if activity is None: continue self.info(activity) raise
def is_agency_idle(self, agency): return all([agent.is_idle() for agent in agency.get_agents()])