From 9bdd043874f02d7148319d1591a94094f72f135f Mon Sep 17 00:00:00 2001 From: Everett Hildenbrandt Date: Tue, 29 May 2018 07:34:02 -0600 Subject: test.py, JSONSchema/*: factor out common schema definitions --- test.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'test.py') 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/"): -- cgit