Commit Graph

18 Commits

Author SHA1 Message Date
Martyn Inglis
5cd0507e99 Revert "Fixed faoiling jenkins tests. Mocked the required functions"
This reverts commit 4b60c8dada.
2017-03-30 10:46:15 +01:00
Martyn Inglis
4b60c8dada Fixed faoiling jenkins tests. Mocked the required functions 2017-03-23 15:05:56 +00:00
Paul Craig
ffb813bb3f Add get_notifications json schema + tests
Add a schema that corresponds to our response for returning lists
of notifications, and test with a contract test.
2016-11-25 16:50:20 +00:00
Paul Craig
ebfac180c0 Add contract test for 'v2' email notification
We don't have a way of creating letter notifications just yet, so
this is all we can test.
2016-11-22 13:40:55 +00:00
Paul Craig
7ae427c4ef Use jsonschema validation + remove 'v2' schema
Emualated the validation methods that exist [in the python-client](620e5f7014/integration_test/__init__.py).

The `validate_v0` function loads json schemas from a local
`/schemas` directory, whereas the new `validate` function (which
we're going to use for our v2 API calls) uses the common
`get_notification_response` python schema defined in
"app/v2/notifications/notification_schemas.py".

Removed the new `v2` schema from the last commit as it's no longer
being used.

Also, refactored common code in the GET and POST contract files
so that making requests and converting responses to JSON are
pulled out into common functions.
2016-11-22 13:40:22 +00:00
Paul Craig
fb50bb6325 Add 'v2' notification schema to contract tests
Converted python-based schema in
"app/v2/notifications/notification_schema.py" into a pure json
schema and tested it with the new "v2/" API route to confirm that
it validates.

Also refactored some common code in the public contract GET tests
that returns notifications.
2016-11-22 12:07:05 +00:00
Martyn Inglis
20ccdab3bd Contract tests mock the new deliver_email|sms tasks 2016-09-28 15:28:45 +01:00
Imdad Ahad
23998a4d55 Add additionalProperties to links object 2016-09-21 09:47:50 +01:00
Imdad Ahad
afd381badf Update links schema to be more strict and fix import 2016-09-20 10:39:15 +01:00
Imdad Ahad
5b0162cc60 Update schema to validate {notifications} contains a {links} object with expected properties 2016-09-16 14:56:14 +01:00
Martyn Inglis
e0d46d821d Merge branch 'master' into delete-csv-file-after-7-days
Conflicts:
	app/notifications/rest.py
2016-09-12 16:33:01 +01:00
Imdad Ahad
41681ac001 Fix mocker syntax issue 2016-09-07 11:17:27 +01:00
Leo Hemsted
7240df0641 replace mock with unittest.mock 2016-08-31 12:39:11 +01:00
Leo Hemsted
c91358673f 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
2016-08-31 12:33:45 +01:00
Leo Hemsted
fabbb8b01b separate tests for api and job notifications 2016-08-31 11:53:54 +01:00
Leo Hemsted
cb0491cbff add test for GET /notification
simple schema with oneOf [email, sms].
also fixed error where ref'd schemas weren't being picked up
2016-08-30 19:07:46 +01:00
Leo Hemsted
1b7b4a2ccb separate definitions into separate files to allow reuse
see https://github.com/Julian/jsonschema/issues/98

took boring generic things (eg uuid) into definitions.json, and also
separated email and sms notification objects into respective files
2016-08-30 18:45:54 +01:00
Leo Hemsted
aebaea1072 add public contract tests
use jsonschema to test the GET /notification/{} endpoint to highlight any key name/format/type changes
2016-08-30 15:55:52 +01:00