mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-02 17:48:50 -04:00
fix flake8
This commit is contained in:
@@ -40,7 +40,7 @@ def get_s3_object(
|
|||||||
teststr = str(s3.Bucket(bucket_name).creation_date).lower()
|
teststr = str(s3.Bucket(bucket_name).creation_date).lower()
|
||||||
if "magicmock" not in teststr:
|
if "magicmock" not in teststr:
|
||||||
raise Exception(
|
raise Exception(
|
||||||
f"Test is not mocked, use @mock_aws or the relevant mocker.patch to avoid accessing S3"
|
"Test is not mocked, use @mock_aws or the relevant mocker.patch to avoid accessing S3"
|
||||||
)
|
)
|
||||||
return obj
|
return obj
|
||||||
|
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ def s3upload(
|
|||||||
teststr = str(_s3.Bucket(bucket_name).creation_date).lower()
|
teststr = str(_s3.Bucket(bucket_name).creation_date).lower()
|
||||||
if "magicmock" not in teststr:
|
if "magicmock" not in teststr:
|
||||||
raise Exception(
|
raise Exception(
|
||||||
f"Test is not mocked, use @mock_aws or the relevant mocker.patch to avoid accessing S3"
|
"Test is not mocked, use @mock_aws or the relevant mocker.patch to avoid accessing S3"
|
||||||
)
|
)
|
||||||
|
|
||||||
key = _s3.Object(bucket_name, file_location)
|
key = _s3.Object(bucket_name, file_location)
|
||||||
@@ -102,7 +102,7 @@ def s3download(
|
|||||||
teststr = str(s3.Bucket(bucket_name).creation_date).lower()
|
teststr = str(s3.Bucket(bucket_name).creation_date).lower()
|
||||||
if "magicmock" not in teststr:
|
if "magicmock" not in teststr:
|
||||||
raise Exception(
|
raise Exception(
|
||||||
f"Test is not mocked, use @mock_aws or the relevant mocker.patch to avoid accessing S3"
|
"Test is not mocked, use @mock_aws or the relevant mocker.patch to avoid accessing S3"
|
||||||
)
|
)
|
||||||
return key.get()["Body"]
|
return key.get()["Body"]
|
||||||
except botocore.exceptions.ClientError as error:
|
except botocore.exceptions.ClientError as error:
|
||||||
|
|||||||
Reference in New Issue
Block a user