mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-25 00:33:41 -04:00
Work in progress, skeleton of the api created and testing started. Need to fix authentication tests.
This commit is contained in:
0
tests/app/service/__init__.py
Normal file
0
tests/app/service/__init__.py
Normal file
0
tests/app/service/views/__init__.py
Normal file
0
tests/app/service/views/__init__.py
Normal file
33
tests/app/service/views/test_rest.py
Normal file
33
tests/app/service/views/test_rest.py
Normal file
@@ -0,0 +1,33 @@
|
||||
import json
|
||||
from flask import url_for
|
||||
|
||||
|
||||
def test_get_service_list(notify_api, notify_db, notify_db_session, sample_service):
|
||||
with notify_api.test_request_context():
|
||||
with notify_api.test_client() as client:
|
||||
response = client.get(url_for('service.get_service'))
|
||||
assert response.status_code == 200
|
||||
json_resp = json.loads(response.get_data(as_text=True))
|
||||
# TODO assert correct json returned
|
||||
assert len(json_resp['data']) == 1
|
||||
assert json_resp['data'][0]['name'] == sample_service.name
|
||||
assert json_resp['data'][0]['id'] == sample_service.id
|
||||
|
||||
|
||||
def test_get_service(notify_api, notify_db, notify_db_session, sample_service):
|
||||
with notify_api.test_request_context():
|
||||
with notify_api.test_client() as client:
|
||||
resp = client.get(url_for('service.get_service',
|
||||
service_id=sample_service.id))
|
||||
assert resp.status_code == 200
|
||||
json_resp = json.loads(resp.get_data(as_text=True))
|
||||
assert json_resp['data']['name'] == sample_service.name
|
||||
assert json_resp['data']['id'] == sample_service.id
|
||||
|
||||
|
||||
def test_post_service(notify_api, notify_db, notify_db_session, sample_service):
|
||||
pass
|
||||
|
||||
|
||||
def test_put_service(notify_api, notify_db, notify_db_session, sample_service):
|
||||
pass
|
||||
Reference in New Issue
Block a user