aboutsummaryrefslogtreecommitdiffstats
path: root/test.py
diff options
context:
space:
mode:
authorEverett Hildenbrandt <hildenb2@illinois.edu>2018-05-29 21:34:02 +0800
committerEverett Hildenbrandt <hildenb2@illinois.edu>2018-05-31 22:37:30 +0800
commit9bdd043874f02d7148319d1591a94094f72f135f (patch)
tree73aeda037291fd3c71099bc7f7dde5fd6c04f371 /test.py
parentea227d5d888542ebd7c6e7d504a1ddf1a534761a (diff)
downloaddexon-tests-9bdd043874f02d7148319d1591a94094f72f135f.tar.gz
dexon-tests-9bdd043874f02d7148319d1591a94094f72f135f.tar.zst
dexon-tests-9bdd043874f02d7148319d1591a94094f72f135f.zip
test.py, JSONSchema/*: factor out common schema definitions
Diffstat (limited to 'test.py')
-rwxr-xr-xtest.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/test.py b/test.py
index bb9e345d4..0db989cb1 100755
--- a/test.py
+++ b/test.py
@@ -65,9 +65,15 @@ def findTests(testDir="."):
def validateSchema(jsonFile, schemaFile):
_report("validating", jsonFile, "with", schemaFile)
+
testSchema = readJSONFile(schemaFile)
- jsonInput = readJSONFile(jsonFile)
- jsonschema.validate(jsonInput, testSchema)
+ defSchema = readJSONFile("JSONSchema/definitions.json")
+ schema = { "definitions" : dict(defSchema["definitions"], **testSchema["definitions"])
+ , "patternProperties" : testSchema["patternProperties"]
+ }
+
+ jsonInput = readJSONFile(jsonFile)
+ jsonschema.validate(jsonInput, schema)
def validateTestFile(jsonFile):
if jsonFile.startswith("src/GeneralStateTestsFiller/"):