-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #150 from nelc/tehreem/add_signed_url_for_s3_stora…
…ge_data_export_file feat: add signed url for data export download file
- Loading branch information
Showing
4 changed files
with
117 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
"""Mocked botot3 client """ | ||
|
||
|
||
def client(*args, **kwargs): | ||
""" | ||
Fake boto3.client implementation that returns a FakeS3Client. | ||
Mimics the behavior of the real boto3.client but without making any actual API calls. | ||
""" | ||
class FakeS3Client: # pylint: disable=too-few-public-methods | ||
""" | ||
A fake S3 client to mock boto3 client behavior. | ||
""" | ||
def generate_presigned_url(self, *args, **kwargs): # pylint: disable=no-self-use | ||
params = kwargs.get('Params', {}) | ||
file_key = params.get('Key', 'default-file.csv') | ||
return f'http://fake-s3-url.com/signed-{file_key}' | ||
|
||
return FakeS3Client() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
"""Fake S3Boto3Storage""" | ||
|
||
|
||
class S3Boto3Storage: # pylint: disable=too-few-public-methods | ||
""" | ||
A minimal class to simulate the behavior of S3Boto3Storage for mocking purposes. | ||
This class does not implement any actual functionality but can only be used in tests. | ||
""" | ||
pass # pylint: disable=unnecessary-pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters