mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-23 15:57:23 -04:00
Refactor to split s3_client.py into multiple files
Separated s3_client.py into 3 files - for logos, CSV files and the MOU. This helps to keep things clearer now that we need to add lots more logo functions for letters.
This commit is contained in:
21
tests/app/s3_client/test_s3_csv_client.py
Normal file
21
tests/app/s3_client/test_s3_csv_client.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from unittest.mock import Mock
|
||||
|
||||
from app.s3_client.s3_csv_client import set_metadata_on_csv_upload
|
||||
|
||||
|
||||
def test_sets_metadata(client, mocker):
|
||||
mocked_s3_object = Mock()
|
||||
mocked_get_s3_object = mocker.patch(
|
||||
'app.s3_client.s3_csv_client.get_csv_upload',
|
||||
return_value=mocked_s3_object,
|
||||
)
|
||||
|
||||
set_metadata_on_csv_upload('1234', '5678', foo='bar', baz=True)
|
||||
|
||||
mocked_get_s3_object.assert_called_once_with('1234', '5678')
|
||||
mocked_s3_object.copy_from.assert_called_once_with(
|
||||
CopySource='test-notifications-csv-upload/service-1234-notify/5678.csv',
|
||||
Metadata={'baz': 'True', 'foo': 'bar'},
|
||||
MetadataDirective='REPLACE',
|
||||
ServerSideEncryption='AES256',
|
||||
)
|
||||
Reference in New Issue
Block a user