def test_failure(self): with pytest.raises(validate.ValidationError) as cm: validate.validate(validate.hasattr("bar"), self.Subject()) assert_validationerror( cm.value, """ ValidationError(Callable): getter(Subject) is not true """)
def test_hasattr(self): el = Element("foo") assert validate(hasattr("tag"), el) == el
def test_success(self, ): assert validate.validate(validate.hasattr("foo"), self.Subject())