diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2021-07-07 20:45:06 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2021-07-08 10:53:25 +0200 |
| commit | 5ec19973eb3d23046d874b097275857a58c23082 (patch) | |
| tree | a601cd975f8917fb2d4af28e8a3fb228e0cb769e /opendc-web/opendc-web-api/tests/api/test_portfolios.py | |
| parent | 02a2f0f89cb1f39a5f8856bca1971a4e1b12374f (diff) | |
api: Add endpoints for accessing project relations
This change adds additional endpoints to the REST API to access the
project relations, the portfolios and topologies that belong to a
project.
Diffstat (limited to 'opendc-web/opendc-web-api/tests/api/test_portfolios.py')
| -rw-r--r-- | opendc-web/opendc-web-api/tests/api/test_portfolios.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/opendc-web/opendc-web-api/tests/api/test_portfolios.py b/opendc-web/opendc-web-api/tests/api/test_portfolios.py index da7991f6..196fcb1c 100644 --- a/opendc-web/opendc-web-api/tests/api/test_portfolios.py +++ b/opendc-web/opendc-web-api/tests/api/test_portfolios.py @@ -322,3 +322,19 @@ def test_add_portfolio(client, mocker): assert 'projectId' in res.json['data'] assert 'scenarioIds' in res.json['data'] assert '200' in res.status + + +def test_get_portfolio_scenarios(client, mocker): + mocker.patch.object(db, + 'fetch_one', + return_value={ + 'projectId': test_id, + '_id': test_id, + 'authorizations': [{ + 'userId': 'test', + 'level': 'EDIT' + }] + }) + mocker.patch.object(db, 'fetch_all', return_value=[{'_id': test_id}]) + res = client.get(f'/portfolios/{test_id}/scenarios') + assert '200' in res.status |
