diff options
| author | jc0b <j@jc0b.computer> | 2020-07-10 15:18:44 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2020-08-24 19:48:00 +0200 |
| commit | 4befa57993831274ad7e6ca62f96aa582f81cc5d (patch) | |
| tree | 697f688b084a5339be80184361a39af592d20b41 /web-server/opendc/api/v2/prefabs/test_endpoint.py | |
| parent | 0e6283dafb3378a4e86de330f3f53aa100b757de (diff) | |
Finished prefabs API
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 |
