def __call__(self, data): self.count += 1 data['my_key'] = self.count if self.side_effect == self.SLA_VALIDATION_ERROR_SIDE_EFFECT: raise y_exc.SLAValidationError(case_name='My Case', error_msg='my error message') elif self.side_effect == self.BROAD_EXCEPTION_SIDE_EFFECT: raise y_exc.YardstickException return self.count
def verify_SLA(self, condition, error_msg): if not condition: raise y_exc.SLAValidationError( case_name=self.__scenario_type__, error_msg=error_msg)