mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-20 23:41:17 -05:00
Updated schema description
This commit is contained in:
@@ -4,7 +4,7 @@ from app.schema_validation.definitions import uuid
|
|||||||
|
|
||||||
get_template_by_id_request = {
|
get_template_by_id_request = {
|
||||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
"$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",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"id": uuid,
|
"id": uuid,
|
||||||
|
|||||||
@@ -40,13 +40,12 @@ invalid_request_args = [
|
|||||||
({"id": str(uuid.uuid4()), "version": 0}, ["version 0 is less than the minimum of 1"]),
|
({"id": str(uuid.uuid4()), "version": 0}, ["version 0 is less than the minimum of 1"]),
|
||||||
({"version": 1}, ["id is a required property"]),
|
({"version": 1}, ["id is a required property"]),
|
||||||
({"id": "invalid_uuid"}, ["id is not a valid UUID"]),
|
({"id": "invalid_uuid"}, ["id is not a valid UUID"]),
|
||||||
({"id": "invalid_uuid", "version": 0}, ["version 0 is less than the minimum of 1",
|
({"id": "invalid_uuid", "version": 0}, ["version 0 is less than the minimum of 1", "id is not a valid UUID"])
|
||||||
"id is not a valid UUID"])
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("args", valid_request_args)
|
@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
|
assert validate(args, get_template_by_id_request) == args
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user