diff options
| author | Georgios Andreadis <info@gandreadis.com> | 2020-06-29 18:25:31 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2020-08-24 19:37:04 +0200 |
| commit | add081f5de9a755fea324675804d6783b1def855 (patch) | |
| tree | 09e0f228becf84e56dd8f3b355bc3d5099d7d36e /web-server/opendc/api/v2/simulations/simulationId | |
| parent | b50558d6ce990ada3d4b4c1b4fbb6eaf582d5dad (diff) | |
Add traces endpoint
Diffstat (limited to 'web-server/opendc/api/v2/simulations/simulationId')
| -rw-r--r-- | web-server/opendc/api/v2/simulations/simulationId/test_endpoint.py | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/web-server/opendc/api/v2/simulations/simulationId/test_endpoint.py b/web-server/opendc/api/v2/simulations/simulationId/test_endpoint.py index a0586aab..7038f1b0 100644 --- a/web-server/opendc/api/v2/simulations/simulationId/test_endpoint.py +++ b/web-server/opendc/api/v2/simulations/simulationId/test_endpoint.py @@ -85,13 +85,33 @@ def test_delete_simulation_non_existing(client, mocker): def test_delete_simulation_different_user(client, mocker): - mocker.patch.object(DB, 'fetch_one', return_value={'_id': '1', 'googleId': 'other_test', 'authorizations': [{'simulationId': '1', 'authorizationLevel': 'VIEW'}], 'topologyIds': []}) + mocker.patch.object(DB, + 'fetch_one', + return_value={ + '_id': '1', + 'googleId': 'other_test', + 'authorizations': [{ + 'simulationId': '1', + 'authorizationLevel': 'VIEW' + }], + 'topologyIds': [] + }) mocker.patch.object(DB, 'delete_one', return_value=None) assert '403' in client.delete('/api/v2/simulations/1').status def test_delete_simulation(client, mocker): - mocker.patch.object(DB, 'fetch_one', return_value={'_id': '1', 'googleId': 'test', 'authorizations': [{'simulationId': '1', 'authorizationLevel': 'OWN'}], 'topologyIds': []}) + mocker.patch.object(DB, + 'fetch_one', + return_value={ + '_id': '1', + 'googleId': 'test', + 'authorizations': [{ + 'simulationId': '1', + 'authorizationLevel': 'OWN' + }], + 'topologyIds': [] + }) mocker.patch.object(DB, 'delete_one', return_value={'googleId': 'test'}) res = client.delete('/api/v2/simulations/1') assert '200' in res.status |
