mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-05 02:41:14 -05:00
Merge pull request #482 from alphagov/swagger-spike
Publish a Swagger specification
This commit is contained in:
18
tests/app/spec/test_rest.py
Normal file
18
tests/app/spec/test_rest.py
Normal file
@@ -0,0 +1,18 @@
|
||||
import flex
|
||||
import pytest
|
||||
|
||||
from flask import json
|
||||
from tests import create_authorization_header
|
||||
|
||||
|
||||
def test_spec_returns_valid_json(notify_api, sample_notification):
|
||||
with notify_api.test_request_context():
|
||||
with notify_api.test_client() as client:
|
||||
auth_header = create_authorization_header(service_id=sample_notification.service_id)
|
||||
|
||||
response = client.get('/spec', headers=[auth_header])
|
||||
|
||||
# Check that it’s a valid Swagger schema
|
||||
flex.load(
|
||||
json.loads(response.get_data(as_text=True))
|
||||
)
|
||||
Reference in New Issue
Block a user