diff options
| author | jc0b <j@jc0b.computer> | 2020-07-21 21:22:44 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2020-08-24 19:48:14 +0200 |
| commit | 67b6ec800df8e023efadb60ae5f7919030b19789 (patch) | |
| tree | 9aa496408a4097857b6a032b84dd0a396321e1d3 /web-server/opendc/api/v2/prefabs/test_endpoint.py | |
| parent | 5b4ab37ac7be2b2c34e2fad928b0cd7f3a837263 (diff) | |
| parent | 04686bf5cef4aea51fd613a158aa8b155763d0e7 (diff) | |
Merge branch 'master' onto local working copy
Preserve working copy while updating
Diffstat (limited to 'web-server/opendc/api/v2/prefabs/test_endpoint.py')
| -rw-r--r-- | web-server/opendc/api/v2/prefabs/test_endpoint.py | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/web-server/opendc/api/v2/prefabs/test_endpoint.py b/web-server/opendc/api/v2/prefabs/test_endpoint.py deleted file mode 100644 index 47029579..00000000 --- a/web-server/opendc/api/v2/prefabs/test_endpoint.py +++ /dev/null @@ -1,22 +0,0 @@ -from opendc.util.database import DB - - -def test_add_prefab_missing_parameter(client): - assert '400' in client.post('/api/v2/prefabs').status - - -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', - 'authorId': 1 - }) - 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 |
