mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-21 23:46:18 -05:00
Creating background_task function to keep set of tasks from being cleaned up during garbage collection.
This commit is contained in:
parent
6fa6be50fe
commit
1230a3056d
11 changed files with 65 additions and 43 deletions
|
|
@ -86,17 +86,8 @@ def test_status_and_import(test_client, test_session, test_directory):
|
|||
def test_empty_import(test_client, test_session, test_directory):
|
||||
"""Some files must be requested."""
|
||||
with mock.patch('modules.map.lib.import_file') as mock_import_file:
|
||||
body = {'pbfs': []}
|
||||
request, response = test_client.post('/api/map/import', content=json.dumps(body))
|
||||
assert response.status_code == HTTPStatus.BAD_REQUEST
|
||||
mock_import_file.assert_not_called()
|
||||
|
||||
body = {'dumps': []}
|
||||
request, response = test_client.post('/api/map/import', content=json.dumps(body))
|
||||
assert response.status_code == HTTPStatus.BAD_REQUEST
|
||||
mock_import_file.assert_not_called()
|
||||
|
||||
body = {'pbfs': [], 'dumps': []}
|
||||
body = {'files': []}
|
||||
request, response = test_client.post('/api/map/import', content=json.dumps(body))
|
||||
assert response.status_code == HTTPStatus.BAD_REQUEST
|
||||
mock_import_file.assert_not_called()
|
||||
assert 'validate' in response.json['error']
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue