Skip to content
This repository was archived by the owner on Mar 31, 2026. It is now read-only.

Commit 0323647

Browse files
authored
Fix: Add regression test for range read retry issue and bump dependency to fix (#1338)
1 parent 5c93503 commit 0323647

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"google-auth >= 2.26.1, < 3.0dev",
3232
"google-api-core >= 2.15.0, <3.0.0dev",
3333
"google-cloud-core >= 2.3.0, < 3.0dev",
34-
"google-resumable-media >= 2.6.0",
34+
"google-resumable-media >= 2.7.2",
3535
"requests >= 2.18.0, < 3.0.0dev",
3636
"google-crc32c >= 1.0, < 2.0dev",
3737
]

tests/conformance/test_conformance.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,17 @@ def blob_download_to_filename_chunked(client, _preconditions, **resources):
115115
assert stored_contents == data
116116

117117

118+
def blob_download_to_filename_range(client, _preconditions, **resources):
119+
bucket = resources.get("bucket")
120+
file, data = resources.get("file_data")
121+
blob = client.bucket(bucket.name).blob(file.name)
122+
with tempfile.NamedTemporaryFile() as temp_f:
123+
blob.download_to_filename(temp_f.name, start=1024, end=512 * 1024)
124+
with open(temp_f.name, "r") as file_obj:
125+
stored_contents = file_obj.read()
126+
assert stored_contents == data[1024 : 512 * 1024 + 1]
127+
128+
118129
def client_download_blob_to_file(client, _preconditions, **resources):
119130
bucket = resources.get("bucket")
120131
file, data = resources.get("file_data")
@@ -748,6 +759,7 @@ def object_acl_clear(client, _preconditions, **resources):
748759
client_download_blob_to_file,
749760
blob_download_to_filename,
750761
blob_download_to_filename_chunked,
762+
blob_download_to_filename_range,
751763
blob_download_as_bytes,
752764
blob_download_as_text,
753765
blobreader_read,
@@ -756,6 +768,7 @@ def object_acl_clear(client, _preconditions, **resources):
756768
client_download_blob_to_file,
757769
blob_download_to_filename,
758770
blob_download_to_filename_chunked,
771+
blob_download_to_filename_range,
759772
blob_download_as_bytes,
760773
blob_download_as_text,
761774
blobreader_read,

0 commit comments

Comments
 (0)