mirror of
https://github.com/GSA/notifications-admin.git
synced 2025-12-14 00:52:55 -05:00
remove some fixtures
This commit is contained in:
@@ -93,6 +93,17 @@ def s3download(
|
||||
)
|
||||
s3 = session.resource("s3", config=AWS_CLIENT_CONFIG)
|
||||
key = s3.Object(bucket_name, filename)
|
||||
# This 'proves' that use of moto in the relevant tests in test_send.py
|
||||
# mocks everything related to S3. What you will see in the logs is:
|
||||
# Exception: CREATED AT <MagicMock name='resource().Bucket().creation_date' id='4665562448'>
|
||||
#
|
||||
# raise Exception(f"CREATED AT {_s3.Bucket(bucket_name).creation_date}")
|
||||
if os.getenv("NOTIFY_ENVIRONMENT") == "test":
|
||||
teststr = str(s3.Bucket(bucket_name).creation_date).lower()
|
||||
if "magicmock" not in teststr:
|
||||
raise Exception(
|
||||
f"xxxxxtest not mocked, use @mock_aws creation date is {teststr}"
|
||||
)
|
||||
return key.get()["Body"]
|
||||
except botocore.exceptions.ClientError as error:
|
||||
raise S3ObjectNotFound(error.response, error.operation_name)
|
||||
|
||||
Reference in New Issue
Block a user