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:
Leo Hemsted
2016-08-31 12:22:05 +01:00
parent fabbb8b01b
commit c91358673f
11 changed files with 105 additions and 7 deletions

View File

@@ -18,7 +18,7 @@ def test_get_api_sms_contract(client, sample_notification):
auth_header = create_authorization_header(service_id=sample_notification.service_id)
response = client.get('/notifications/{}'.format(sample_notification.id), headers=[auth_header])
validate(response.get_data(as_text=True), './GET_notification_return_sms.json')
validate(response.get_data(as_text=True), 'GET_notification_return_sms.json')
def test_get_api_email_contract(client, sample_email_notification):
@@ -35,25 +35,25 @@ def test_get_api_email_contract(client, sample_email_notification):
auth_header = create_authorization_header(service_id=sample_email_notification.service_id)
response = client.get('/notifications/{}'.format(sample_email_notification.id), headers=[auth_header])
validate(response.get_data(as_text=True), './GET_notification_return_email.json')
validate(response.get_data(as_text=True), 'GET_notification_return_email.json')
def test_get_job_sms_contract(client, sample_notification):
auth_header = create_authorization_header(service_id=sample_notification.service_id)
response = client.get('/notifications/{}'.format(sample_notification.id), headers=[auth_header])
validate(response.get_data(as_text=True), './GET_notification_return_sms.json')
validate(response.get_data(as_text=True), 'GET_notification_return_sms.json')
def test_get_job_email_contract(client, sample_email_notification):
auth_header = create_authorization_header(service_id=sample_email_notification.service_id)
response = client.get('/notifications/{}'.format(sample_email_notification.id), headers=[auth_header])
validate(response.get_data(as_text=True), './GET_notification_return_email.json')
validate(response.get_data(as_text=True), 'GET_notification_return_email.json')
def test_get_notifications_contract(client, sample_notification, sample_email_notification):
auth_header = create_authorization_header(service_id=sample_notification.service_id)
response = client.get('/notifications', headers=[auth_header])
validate(response.get_data(as_text=True), './GET_notifications_return.json')
validate(response.get_data(as_text=True), 'GET_notifications_return.json')