Creating background_task function to keep set of tasks from being cleaned up during garbage collection.

This commit is contained in:
Roland 2022-10-22 14:26:59 -06:00
parent 6fa6be50fe
commit 1230a3056d
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93
11 changed files with 65 additions and 43 deletions

View file

@ -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']