Skip to content

Commit dca10e5

Browse files
committed
Tests
1 parent 5d0115a commit dca10e5

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/test_exceptions.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import pytest
2+
3+
from jsonpath_ng import parse as rw_parse
4+
from jsonpath_ng.exceptions import JSONPathError, JsonPathParserError
5+
from jsonpath_ng.ext import parse as ext_parse
6+
7+
8+
def test_rw_exception_class():
9+
with pytest.raises(JSONPathError):
10+
rw_parse('foo.bar.`grandparent`.baz')
11+
12+
13+
def test_rw_exception_subclass():
14+
with pytest.raises(JsonPathParserError):
15+
rw_parse('foo.bar.`grandparent`.baz')
16+
17+
18+
def test_ext_exception_subclass():
19+
with pytest.raises(JsonPathParserError):
20+
ext_parse('foo.bar.`grandparent`.baz')

0 commit comments

Comments
 (0)