def prepare(self): """ :raise self.prepare_exc: """ self.log.info("Preparing mock") self.was_prepare = True self.check_iterations = int(self.settings.get('check_iterations', "2")) self.postproc_exc = self.get_exc("postproc") self.check_exc = self.get_exc("check") self.prepare_exc = self.get_exc("prepare") self.startup_exc = self.get_exc("startup") self.shutdown_exc = self.get_exc("shutdown") if isinstance(self.engine.aggregator, ResultsReader): reader = MockReader() for num in range(0, self.check_iterations): for quan in range(0, int(random.random() * 10)): reader.data.append(random_sample(num)) self.engine.aggregator.add_reader(reader) if self.prepare_exc: raise self.prepare_exc
def prepare(self): """ :raise self.prepare_exc: """ self.log.info("Preparing mock") self.was_prepare = True self.check_iterations = int(self.settings.get('check_iterations', "2")) self.postproc_exc = self.get_exc("postproc") self.check_exc = self.get_exc("check") self.prepare_exc = self.get_exc("prepare") self.startup_exc = self.get_exc("startup") self.shutdown_exc = self.get_exc("shutdown") if isinstance(self.engine.aggregator, ResultsReader): reader = MockReader() for num in range(0, self.check_iterations): for quan in range(0, int(random.random() * 10)): reader.data.append(random_sample(num)) self.engine.aggregator.add_reader(reader) if self.prepare_exc: raise self.prepare_exc