Updated schema description

This commit is contained in:
Ken Tsang
2017-03-14 17:53:49 +00:00
parent a596a1bb87
commit 7558a7661a
2 changed files with 3 additions and 4 deletions

View File

@@ -4,7 +4,7 @@ from app.schema_validation.definitions import uuid
get_template_by_id_request = {
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "schema for query parameters allowed when getting list of notifications",
"description": "schema for parameters allowed when getting template by id",
"type": "object",
"properties": {
"id": uuid,

View File

@@ -40,13 +40,12 @@ invalid_request_args = [
({"id": str(uuid.uuid4()), "version": 0}, ["version 0 is less than the minimum of 1"]),
({"version": 1}, ["id is a required property"]),
({"id": "invalid_uuid"}, ["id is not a valid UUID"]),
({"id": "invalid_uuid", "version": 0}, ["version 0 is less than the minimum of 1",
"id is not a valid UUID"])
({"id": "invalid_uuid", "version": 0}, ["version 0 is less than the minimum of 1", "id is not a valid UUID"])
]
@pytest.mark.parametrize("args", valid_request_args)
def test_get_template_request_schema__against_valid_args_is_valid(args):
def test_get_template_request_schema_against_valid_args_is_valid(args):
assert validate(args, get_template_by_id_request) == args