Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
updated stream test
Browse files Browse the repository at this point in the history
  • Loading branch information
dominictarro committed Jun 26, 2023
1 parent fc3c252 commit 9bcb31f
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions tests/test_s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -622,11 +622,26 @@ def s3_bucket_empty(self, credentials, bucket):
_s3_bucket = S3Bucket(bucket_name="bucket", credentials=credentials)
return _s3_bucket

@pytest.fixture
def s3_bucket_2_empty(self, credentials, bucket):
_s3_bucket = S3Bucket(
bucket_name="bucket",
credentials=credentials,
bucket_folder="subfolder",
)
return _s3_bucket

@pytest.fixture
def s3_bucket_with_object(self, s3_bucket_empty, object):
_s3_bucket_with_object = s3_bucket_empty # object will be added
return _s3_bucket_with_object

@pytest.fixture
def s3_bucket_2_with_object(self, s3_bucket_2_empty):
_s3_bucket_with_object = s3_bucket_2_empty
s3_bucket_2_empty.write_path("object", content=b"TEST")
return _s3_bucket_with_object

@pytest.fixture
def s3_bucket_with_objects(self, s3_bucket_with_object, object_in_folder):
_s3_bucket_with_objects = (
Expand Down Expand Up @@ -719,12 +734,12 @@ def test_download_folder_to_path(
@pytest.mark.parametrize("client_parameters", aws_clients[-1:], indirect=True)
def test_stream_from(
self,
s3_bucket_with_object: S3Bucket,
s3_bucket_2_with_object: S3Bucket,
s3_bucket_empty: S3Bucket,
client_parameters,
to_path,
):
path = s3_bucket_empty.stream_from(s3_bucket_with_object, "object", to_path)
path = s3_bucket_empty.stream_from(s3_bucket_2_with_object, "object", to_path)
data: bytes = s3_bucket_empty.read_path(path)
assert data == b"TEST"

Expand Down

0 comments on commit 9bcb31f

Please sign in to comment.