def test_jobs_update_job_errors(err_instance, expected_return_code): dr = dummy_request() with patch('mycroft.models.aws_connections.TableConnection.get_connection'): with patch('mycroft.views.jobs.get_scanner_queue'): with patch('mycroft.views.jobs.put_job') as put_job: put_job.side_effect = err_instance actual_return_code, _ = jobs_update_job(dr) assert actual_return_code == expected_return_code
def test_jobs_update_job_errors(err_instance, expected_return_code): dr = dummy_request() with patch( 'mycroft.models.aws_connections.TableConnection.get_connection'): with patch('mycroft.views.jobs.get_scanner_queue'): with patch('mycroft.views.jobs.put_job') as put_job: put_job.side_effect = err_instance actual_return_code, _ = jobs_update_job(dr) assert actual_return_code == expected_return_code
def test_jobs_update_job(request_method, parm): dr = dummy_request() dr.method = request_method expected_return_code = 200 with patch('mycroft.models.aws_connections.TableConnection.get_connection'): with patch('mycroft.views.jobs.get_scanner_queue'): with patch(parm) as list_action: list_action.return_value = {} actual_return_code, _ = jobs_update_job(dr) assert actual_return_code == expected_return_code
def test_jobs_update_job(request_method, parm): dr = dummy_request() dr.method = request_method expected_return_code = 200 with patch( 'mycroft.models.aws_connections.TableConnection.get_connection'): with patch('mycroft.views.jobs.get_scanner_queue'): with patch(parm) as list_action: list_action.return_value = {} actual_return_code, _ = jobs_update_job(dr) assert actual_return_code == expected_return_code