diff options
| author | Georgios Andreadis <info@gandreadis.com> | 2020-06-30 11:43:07 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2020-08-24 19:42:27 +0200 |
| commit | 676ccde281841005e3f318bf267ea1dbcdf6fc87 (patch) | |
| tree | 53c9257ada1cffeb0cba4f0079e2cad679e0990e /web-server/opendc/api/v2/experiments/experimentId/test_endpoint.py | |
| parent | 9b910a49270311fd6f099f0f0674a1fd0ab48a20 (diff) | |
Add experiment POST
Diffstat (limited to 'web-server/opendc/api/v2/experiments/experimentId/test_endpoint.py')
| -rw-r--r-- | web-server/opendc/api/v2/experiments/experimentId/test_endpoint.py | 44 |
1 files changed, 26 insertions, 18 deletions
diff --git a/web-server/opendc/api/v2/experiments/experimentId/test_endpoint.py b/web-server/opendc/api/v2/experiments/experimentId/test_endpoint.py index 0c9c9abc..35b8b762 100644 --- a/web-server/opendc/api/v2/experiments/experimentId/test_endpoint.py +++ b/web-server/opendc/api/v2/experiments/experimentId/test_endpoint.py @@ -48,12 +48,15 @@ def test_update_experiment_missing_parameter(client): def test_update_experiment_non_existing(client, mocker): mocker.patch.object(DB, 'fetch_one', return_value=None) - assert '404' in client.put('/api/v2/experiments/1', json={'experiment': { - 'topologyId': '1', - 'traceId': '1', - 'schedulerName': 'default', - 'name': 'test', - }}).status + assert '404' in client.put('/api/v2/experiments/1', + json={ + 'experiment': { + 'topologyId': '1', + 'traceId': '1', + 'schedulerName': 'default', + 'name': 'test', + } + }).status def test_update_experiment_not_authorized(client, mocker): @@ -68,12 +71,15 @@ def test_update_experiment_not_authorized(client, mocker): }] }) mocker.patch.object(DB, 'update', return_value={}) - assert '403' in client.put('/api/v2/experiments/1', json={'experiment': { - 'topologyId': '1', - 'traceId': '1', - 'schedulerName': 'default', - 'name': 'test', - }}).status + assert '403' in client.put('/api/v2/experiments/1', + json={ + 'experiment': { + 'topologyId': '1', + 'traceId': '1', + 'schedulerName': 'default', + 'name': 'test', + } + }).status def test_update_experiment(client, mocker): @@ -89,12 +95,14 @@ def test_update_experiment(client, mocker): }) mocker.patch.object(DB, 'update', return_value={}) - res = client.put('/api/v2/experiments/1', json={'experiment': { - 'topologyId': '1', - 'traceId': '1', - 'schedulerName': 'default', - 'name': 'test', - }}) + res = client.put( + '/api/v2/experiments/1', + json={'experiment': { + 'topologyId': '1', + 'traceId': '1', + 'schedulerName': 'default', + 'name': 'test', + }}) assert '200' in res.status |
