Exemplo n.º 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
     """)
Exemplo n.º 2
0
    def test_hasattr(self):
        el = Element("foo")

        assert validate(hasattr("tag"), el) == el
Exemplo n.º 3
0
    def test_hasattr(self):
        el = Element("foo")

        assert validate(hasattr("tag"), el) == el
Exemplo n.º 4
0
 def test_success(self, ):
     assert validate.validate(validate.hasattr("foo"), self.Subject())