diff options
Diffstat (limited to 'test/test_schema.py')
-rw-r--r-- | test/test_schema.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/test_schema.py b/test/test_schema.py index 10c1a9a..91616a9 100644 --- a/test/test_schema.py +++ b/test/test_schema.py @@ -72,3 +72,16 @@ def test_schema(index: int) -> None: def test_json_path() -> None: """Test json_path function.""" assert json_path(["a", 1, "b"]) == "$.a[1].b" + + +def test_validate_invalid_schema() -> None: + """Test validate function error handling.""" + schema = "[]" + data = json_from_asset("assets/validate0_data.json") + errors = validate(schema, data) + + assert len(errors) == 1 + assert ( + errors[0].to_friendly() + == "In 'schema sanity check': Invalid schema, must be a mapping." + ) |