separate tests for api and job notifications

This commit is contained in:
Leo Hemsted
2016-08-31 11:53:54 +01:00
parent cb0491cbff
commit fabbb8b01b
2 changed files with 53 additions and 16 deletions

View File

@@ -0,0 +1,14 @@
import os
from flask import json
import jsonschema
def validate(json_string, schema_filename):
resolver = jsonschema.RefResolver('file://' + os.path.dirname(__file__) + '/', None)
with open(os.path.join(os.path.dirname(__file__), schema_filename)) as schema:
jsonschema.validate(
json.loads(json_string),
json.load(schema),
format_checker=jsonschema.FormatChecker(),
resolver=resolver
)