mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-02 17:31:14 -05:00
separate tests for api and job notifications
This commit is contained in:
@@ -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
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user