Example #1
0
 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
     """)
Example #2
0
    def test_hasattr(self):
        el = Element("foo")

        assert validate(hasattr("tag"), el) == el
Example #3
0
    def test_hasattr(self):
        el = Element("foo")

        assert validate(hasattr("tag"), el) == el
Example #4
0
 def test_success(self, ):
     assert validate.validate(validate.hasattr("foo"), self.Subject())