Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_celery_task_is_pending___result_is_pending(self):
response = self.app.get('/analysis_status/{}'.format('location'))
self.assertEqual(json.loads(response.data.decode('utf-8')), {
'id': -1,
'status': status.STATUS_PENDING,
'message': '',
'outputs_location': None,
})
@patch('src.server.app.CELERY.AsyncResult', Mock(return_value=fake_result('message', status.STATUS_PENDING)))
def test_celery_task_is_pending___result_is_pending(self):
response = self.app.get('/analysis_status/{}'.format('location'))
self.assertEqual(json.loads(response.data.decode('utf-8')), {
'id': -1,
'status': status.STATUS_PENDING,
'message': '',
'outputs_location': None,
})