Esempio n. 1
0
def test_parse_check_and_extract(expression, data, expect):
    jp = parse(expression)
    logging.debug(f"parse {expression!r} result: {jp}")
    assert jp.get_expression() == expression
    assert_find(jp, data, expect)
Esempio n. 2
0
def test_syntax_error(expression):
    with pytest.raises(JSONPathSyntaxError):
        parse(expression)
Esempio n. 3
0
def test_undefined_function_error():
    with pytest.raises(JSONPathUndefinedFunctionError):
        parse("$[abc(@)]")
Esempio n. 4
0
def test_parse_and_extract(expression, data, expect):
    jp = parse(expression)
    logging.debug(f"parse {expression!r} result: {jp}")
    assert jp.find(data) == expect