def _do_test(self, expression, expected_errors): try: validation = Validator() validation.validate(expression) if not validation.raised_warnings(): self.fail("Expecting issue detected for expression %s" % str(expression)) else: self._verify_issues(expression, validation.errors, expected_errors) except InvalidModel: self._verify_issues(expression, validation.errors, expected_errors)
def _validate(self, expression): validator = Validator() validator.validate(expression) if validator.raised_warnings(): for each_warning in validator.errors: each_warning.accept(self.display)