mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 07:35:34 -05:00
add no such key test
This commit is contained in:
@@ -279,12 +279,12 @@ def test_get_job_from_s3_exponential_backoff_on_throttling(mocker):
|
|||||||
def test_get_job_from_s3_exponential_backoff_on_no_such_key(mocker):
|
def test_get_job_from_s3_exponential_backoff_on_no_such_key(mocker):
|
||||||
# We try multiple times to retrieve the job, and if we can't we return None
|
# We try multiple times to retrieve the job, and if we can't we return None
|
||||||
mock_get_object = mocker.patch(
|
mock_get_object = mocker.patch(
|
||||||
"app.aws.s3.get_s3_object", side_effect=mock_s3_get_object_slowdown
|
"app.aws.s3.get_s3_object", side_effect=mock_s3_get_object_no_such_key
|
||||||
)
|
)
|
||||||
mocker.patch("app.aws.s3.file_exists", return_value=True)
|
mocker.patch("app.aws.s3.file_exists", return_value=True)
|
||||||
job = get_job_from_s3("service_id", "job_id")
|
job = get_job_from_s3("service_id", "job_id")
|
||||||
assert job is None
|
assert job is None
|
||||||
assert mock_get_object.call_count == 8
|
assert mock_get_object.call_count == 2
|
||||||
|
|
||||||
|
|
||||||
def test_get_job_from_s3_exponential_backoff_on_random_exception(mocker):
|
def test_get_job_from_s3_exponential_backoff_on_random_exception(mocker):
|
||||||
|
|||||||
Reference in New Issue
Block a user