File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
packages/google-cloud-storage/tests/unit Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -1567,6 +1567,25 @@ def test_download_as_string_w_hash_response_header_none(self):
15671567 self .assertEqual (blob .md5_hash , md5_hash )
15681568 self .assertEqual (blob .crc32c , crc32c )
15691569
1570+ def test_download_as_string_w_response_headers_not_match (self ):
1571+ blob_name = "blob-name"
1572+ client = mock .Mock (spec = ["_http" ])
1573+ bucket = _Bucket (client )
1574+ media_link = "http://example.com/media/"
1575+ properties = {"mediaLink" : media_link }
1576+ blob = self ._make_one (blob_name , bucket = bucket , properties = properties )
1577+
1578+ response = self ._mock_requests_response (
1579+ http_client .OK ,
1580+ headers = {"X-Goog-Hash" : "bogus=4gcgLQ==," },
1581+ # { "x": 5 } gzipped
1582+ content = b"" ,
1583+ )
1584+ blob ._extract_headers_from_download (response )
1585+
1586+ self .assertIsNone (blob .md5_hash )
1587+ self .assertIsNone (blob .crc32c )
1588+
15701589 def test_download_as_bytes_w_generation_match (self ):
15711590 GENERATION_NUMBER = 6
15721591 MEDIA_LINK = "http://example.com/media/"
You can’t perform that action at this time.
0 commit comments