mirror of
https://github.com/GSA/notifications-api.git
synced 2026-06-01 03:48:35 -04:00
increase code coverage
This commit is contained in:
@@ -601,3 +601,17 @@ def test_get_s3_files_handles_exception(mocker):
|
||||
mock_current_app.logger.exception.assert_called_with(
|
||||
"Trouble reading file2.csv which is # 1 during cache regeneration"
|
||||
)
|
||||
|
||||
|
||||
def test_get_s3_client_with_env_credentials():
|
||||
with patch.dict(
|
||||
os.environ,
|
||||
{
|
||||
"AWS_ACCESS_KEY_ID": "test-key",
|
||||
"AWS_SECRET_ACCESS_ID": "test-sekret",
|
||||
"AWS_DEFAULT_REGION": "us-north-1",
|
||||
},
|
||||
):
|
||||
client = get_s3_client()
|
||||
assert client is not None, "Client should be created with env credentials"
|
||||
assert client._client_config.region_name == "us-north-1"
|
||||
|
||||
@@ -562,6 +562,7 @@ def test_unique_key_on_job_id_and_job_row_number_no_error_if_row_number_for_diff
|
||||
|
||||
def test_jobs_with_same_activity_time_are_sorted_by_id(sample_template):
|
||||
from datetime import datetime
|
||||
|
||||
dt = datetime(2023, 1, 1, 12, 0, 0)
|
||||
|
||||
job1 = create_job(sample_template, created_at=dt, processing_started=None)
|
||||
|
||||
Reference in New Issue
Block a user