diff options
| author | Georgios Andreadis <info@gandreadis.com> | 2020-07-07 09:55:10 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2020-08-24 19:47:25 +0200 |
| commit | b4bdf9fde013bb7ff9579693b64ff575f7b00e44 (patch) | |
| tree | 5e05ceba918849391a639bbeeab37d290a86523c /web-server/opendc/api/v2/simulations/simulationId/authorizations/test_endpoint.py | |
| parent | 7331e9baf2cfe7bdfb24effcf0a4801da1e7ea4d (diff) | |
Rename simulations to projects and remove experiment view
Diffstat (limited to 'web-server/opendc/api/v2/simulations/simulationId/authorizations/test_endpoint.py')
| -rw-r--r-- | web-server/opendc/api/v2/simulations/simulationId/authorizations/test_endpoint.py | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/web-server/opendc/api/v2/simulations/simulationId/authorizations/test_endpoint.py b/web-server/opendc/api/v2/simulations/simulationId/authorizations/test_endpoint.py deleted file mode 100644 index 4369d807..00000000 --- a/web-server/opendc/api/v2/simulations/simulationId/authorizations/test_endpoint.py +++ /dev/null @@ -1,40 +0,0 @@ -from opendc.util.database import DB - - -def test_get_authorizations_non_existing(client, mocker): - mocker.patch.object(DB, 'fetch_one', return_value=None) - mocker.patch.object(DB, 'fetch_all', return_value=None) - assert '404' in client.get('/api/v2/simulations/1/authorizations').status - - -def test_get_authorizations_not_authorized(client, mocker): - mocker.patch.object(DB, - 'fetch_one', - return_value={ - '_id': '1', - 'name': 'test trace', - 'authorizations': [{ - 'simulationId': '2', - 'authorizationLevel': 'OWN' - }] - }) - mocker.patch.object(DB, 'fetch_all', return_value=[]) - res = client.get('/api/v2/simulations/1/authorizations') - assert '403' in res.status - - -def test_get_authorizations(client, mocker): - mocker.patch.object(DB, - 'fetch_one', - return_value={ - '_id': '1', - 'name': 'test trace', - 'authorizations': [{ - 'simulationId': '1', - 'authorizationLevel': 'OWN' - }] - }) - mocker.patch.object(DB, 'fetch_all', return_value=[]) - res = client.get('/api/v2/simulations/1/authorizations') - assert len(res.json['content']) == 0 - assert '200' in res.status |
