Merge pull request #8712 from rragundez/improve-s3-provider-tests

Improve s3 provider tests
This commit is contained in:
Timothy Jaeryang Baek 2025-01-21 11:35:46 -08:00 committed by GitHub
commit ffd10e8b6f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -87,13 +87,17 @@ class TestLocalStorageProvider:
@mock_aws @mock_aws
class TestS3StorageProvider: class TestS3StorageProvider:
Storage = provider.S3StorageProvider()
Storage.bucket_name = "my-bucket" def __init__(self):
s3_client = boto3.resource("s3", region_name="us-east-1") self.Storage = provider.S3StorageProvider()
file_content = b"test content" self.Storage.bucket_name = "my-bucket"
filename = "test.txt" self.s3_client = boto3.resource("s3", region_name="us-east-1")
filename_extra = "test_exyta.txt" self.file_content = b"test content"
file_bytesio_empty = io.BytesIO() self.filename = "test.txt"
self.filename_extra = "test_exyta.txt"
self.file_bytesio_empty = io.BytesIO()
super().__init__()
def test_upload_file(self, monkeypatch, tmp_path): def test_upload_file(self, monkeypatch, tmp_path):
upload_dir = mock_upload_dir(monkeypatch, tmp_path) upload_dir = mock_upload_dir(monkeypatch, tmp_path)