Skip to content

Commit 7506291

Browse files
tests/test_schema_integrity.py: Add test_meta_schema_references
1 parent 017232e commit 7506291

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

tests/test_schema_integrity.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""
44

55
import json
6-
import os.path
6+
import os
77
import sys
88

99
import jsonref
@@ -38,3 +38,16 @@ def test_meta_schema_is_in_sync():
3838
actual = json.load(f)
3939

4040
assert actual == get_metaschema(), "Run: python manage.py pre-commit"
41+
42+
43+
def test_meta_schema_references():
44+
with open("schema/meta-schema.json") as f:
45+
metaschema = json.load(f)
46+
47+
for file_name in os.listdir("schema"):
48+
if file_name.endswith("-schema.json") and "meta-schema" not in file_name:
49+
file_path = os.path.join("schema", file_name)
50+
with open(file_path) as f:
51+
schema = json.load(f)
52+
53+
assert schema["$schema"] == metaschema["id"], f"Incorrect $schema in {file_name}: {schema['$schema']}"

0 commit comments

Comments
 (0)