mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-02 17:31:14 -05:00
add POST response tests
assert that the response for emails and sms is formatted as expected also moved schemas into subdirectory to make folder more legible
This commit is contained in:
@@ -4,8 +4,9 @@ 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:
|
||||
schema_dir = os.path.join(os.path.dirname(__file__), 'schemas')
|
||||
resolver = jsonschema.RefResolver('file://' + schema_dir + '/', None)
|
||||
with open(os.path.join(schema_dir, schema_filename)) as schema:
|
||||
jsonschema.validate(
|
||||
json.loads(json_string),
|
||||
json.load(schema),
|
||||
|
||||
Reference in New Issue
Block a user