diff --git a/tests/test_pub1c-rest.py b/tests/test_pub1c-rest.py index 587ab4d..9ce543c 100644 --- a/tests/test_pub1c-rest.py +++ b/tests/test_pub1c-rest.py @@ -124,3 +124,21 @@ def test_api_infobases_available(client): actual.sort() assert actual == expected + +def test_api_publications(client): + response = client.get('/api/v1/publications') + data = response.get_json() + assert data == [] + + +def test_api_publications_add(client): + endpoint = '/api/v1/publications' + # before add + response = client.get(endpoint) + data = response.get_json() + assert data == [] + # add + response = client.put(path=endpoint, data={'name': 'test123'}) + data = response.get_json() + assert data['message'] == 'created' + assert data['name'] == 'test123'