from .itm import AssertModel from .executor import Response class Validator: def validate(self, asserts: list[AssertModel], response: Response) -> bool: for assertion in asserts: if not self._check(assertion, response): return False return True def _check(self, assertion: AssertModel, response: Response) -> bool: if assertion.type == "status": return response.status == assertion.value if assertion.type == "json": return True return True