From 5b0162cc609d81dabf6307b60b7b296a67d7bd60 Mon Sep 17 00:00:00 2001 From: Imdad Ahad Date: Fri, 16 Sep 2016 14:56:14 +0100 Subject: [PATCH 1/3] Update schema to validate {notifications} contains a {links} object with expected properties --- .../schemas/GET_notifications_return.json | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/app/public_contracts/schemas/GET_notifications_return.json b/tests/app/public_contracts/schemas/GET_notifications_return.json index 7939dd8f1..37ecf74e9 100644 --- a/tests/app/public_contracts/schemas/GET_notifications_return.json +++ b/tests/app/public_contracts/schemas/GET_notifications_return.json @@ -14,7 +14,14 @@ }, "links": { "type": "object", - "additionalProperties": false + "properties" : { + "last": { + "type" : "string" + }, + "next" : { + "type" : "string" + } + } }, "page_size": {"type": "number"}, "total": {"type": "number"} From afd381badfdbd7074954536326d921c023db1f8b Mon Sep 17 00:00:00 2001 From: Imdad Ahad Date: Tue, 20 Sep 2016 10:39:15 +0100 Subject: [PATCH 2/3] Update links schema to be more strict and fix import --- tests/app/notifications/rest/test_callbacks.py | 2 +- .../app/public_contracts/schemas/GET_notifications_return.json | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/app/notifications/rest/test_callbacks.py b/tests/app/notifications/rest/test_callbacks.py index eac7aa477..1d8cc85ca 100644 --- a/tests/app/notifications/rest/test_callbacks.py +++ b/tests/app/notifications/rest/test_callbacks.py @@ -3,7 +3,7 @@ import uuid from datetime import datetime from flask import json from freezegun import freeze_time -from mock import call +from unittest.mock import call import app.celery.tasks from app.dao.notifications_dao import ( diff --git a/tests/app/public_contracts/schemas/GET_notifications_return.json b/tests/app/public_contracts/schemas/GET_notifications_return.json index 37ecf74e9..3c7c23071 100644 --- a/tests/app/public_contracts/schemas/GET_notifications_return.json +++ b/tests/app/public_contracts/schemas/GET_notifications_return.json @@ -20,6 +20,9 @@ }, "next" : { "type" : "string" + }, + "prev" : { + "type" : "string" } } }, From 23998a4d551b6f7494d344ef510fc29ad3286ef4 Mon Sep 17 00:00:00 2001 From: Imdad Ahad Date: Wed, 21 Sep 2016 09:47:50 +0100 Subject: [PATCH 3/3] Add additionalProperties to links object --- .../public_contracts/schemas/GET_notifications_return.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/app/public_contracts/schemas/GET_notifications_return.json b/tests/app/public_contracts/schemas/GET_notifications_return.json index 3c7c23071..709cca9fe 100644 --- a/tests/app/public_contracts/schemas/GET_notifications_return.json +++ b/tests/app/public_contracts/schemas/GET_notifications_return.json @@ -15,16 +15,17 @@ "links": { "type": "object", "properties" : { - "last": { + "prev" : { "type" : "string" }, "next" : { "type" : "string" }, - "prev" : { + "last": { "type" : "string" } - } + }, + "additionalProperties": false }, "page_size": {"type": "number"}, "total": {"type": "number"}