Exemplo n.º 1
0
def evaluate(format_attr, instval, assert_=True):
    FormatKeyword(schema := JSONSchema(True),
                  format_attr).evaluate(JSON(instval), scope := Scope(schema))
    assert scope.annotations["format"].value == format_attr
    assert scope._assert is assert_
    return scope.valid
Exemplo n.º 2
0
def evaluate(kwclass, kwvalue, instval):
    schema = JSONSchema(True)
    kwclass(schema, kwvalue).evaluate(JSON(instval), scope := Scope(schema))
    return scope.valid