in send flow replace suppress with try catch

suppress was suppressing 404 errors (the happy path) - but it was also
suppressing 503s from tests where we hadn't mocked endpoints
This commit is contained in:
Leo Hemsted
2018-05-03 13:35:59 +01:00
parent e8ef6fa174
commit 09a8e863a4
3 changed files with 46 additions and 33 deletions

View File

@@ -1678,6 +1678,14 @@ def mock_get_job(mocker, api_user_active):
return mocker.patch('app.job_api_client.get_job', side_effect=_get_job)
@pytest.fixture
def mock_get_job_doesnt_exist(mocker):
def _get_job(service_id, job_id):
raise HTTPError(response=Mock(status_code=404, json={}), message={})
return mocker.patch('app.job_api_client.get_job', side_effect=_get_job)
@pytest.fixture(scope='function')
def mock_get_scheduled_job(mocker, api_user_active):
def _get_job(service_id, job_id):