diff options
Diffstat (limited to 'web-server/opendc/api/v2/prefabs/test_endpoint.py')
| -rw-r--r-- | web-server/opendc/api/v2/prefabs/test_endpoint.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/web-server/opendc/api/v2/prefabs/test_endpoint.py b/web-server/opendc/api/v2/prefabs/test_endpoint.py index 58735ac7..47029579 100644 --- a/web-server/opendc/api/v2/prefabs/test_endpoint.py +++ b/web-server/opendc/api/v2/prefabs/test_endpoint.py @@ -1,21 +1,22 @@ from opendc.util.database import DB -def test_add_simulation_missing_parameter(client): +def test_add_prefab_missing_parameter(client): assert '400' in client.post('/api/v2/prefabs').status -def test_add_simulation(client, mocker): +def test_add_prefab(client, mocker): mocker.patch.object(DB, 'fetch_one', return_value={'_id': '1', 'authorizations': []}) mocker.patch.object(DB, 'insert', return_value={ '_id': '1', 'datetimeCreated': '000', - 'datetimeLastEdited': '000' + 'datetimeLastEdited': '000', + 'authorId': 1 }) - mocker.patch.object(DB, 'update', return_value={}) res = client.post('/api/v2/prefabs', json={'prefab': {'name': 'test prefab'}}) assert 'datetimeCreated' in res.json['content'] assert 'datetimeLastEdited' in res.json['content'] + assert 'authorId' in res.json['content'] assert '200' in res.status |
