-
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.
feat: add signed url for data export download file
- Loading branch information
1 parent
6ac63f1
commit 31480b3
Showing
4 changed files
with
101 additions
and
2 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,21 @@ | ||
"""Mocked botot3 client """ | ||
|
||
|
||
def client(service_name, *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: | ||
""" | ||
A fake S3 client to mock boto3 client behavior. | ||
""" | ||
def generate_presigned_url(self, *args, **kwargs): | ||
params = kwargs.get('Params', {}) | ||
file_key = params.get('Key', 'default-file.csv') | ||
return f'http://fake-s3-url.com/signed-{file_key}' | ||
|
||
if service_name == 's3': | ||
return FakeS3Client() | ||
else: | ||
raise ValueError(f"Service {service_name} not supported in fake client.") |
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: | ||
""" | ||
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 |
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