From 05d2318538eba71ac0555dc5ec146499d9cb0592 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Fri, 14 May 2021 16:50:23 +0200 Subject: api: Remove user handling from OpenDC API server This change removes any of the user handling and endpoints from the OpenDC API server. The API server does not need to store user information other than an identifier in the database. --- opendc-web/opendc-web-api/opendc/api/v2/projects/test_endpoint.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'opendc-web/opendc-web-api/opendc/api/v2/projects/test_endpoint.py') diff --git a/opendc-web/opendc-web-api/opendc/api/v2/projects/test_endpoint.py b/opendc-web/opendc-web-api/opendc/api/v2/projects/test_endpoint.py index 9444b1e4..db768f28 100644 --- a/opendc-web/opendc-web-api/opendc/api/v2/projects/test_endpoint.py +++ b/opendc-web/opendc-web-api/opendc/api/v2/projects/test_endpoint.py @@ -3,6 +3,13 @@ from opendc.util.database import DB test_id = 24 * '1' +def test_get_user_projects(client, mocker): + mocker.patch.object(DB, 'fetch_all', return_value={'_id': test_id, 'authorizations': [{'userId': 'test', + 'authorizationLevel': 'OWN'}]}) + res = client.get('/v2/projects') + assert '200' in res.status + + def test_add_project_missing_parameter(client): assert '400' in client.post('/v2/projects').status -- cgit v1.2.3