File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -1482,6 +1482,25 @@ def test_download_as_string_w_response_headers(self):
14821482 self .assertEqual (blob .md5_hash , "CS9tHYTtyFntzj7B9nkkJQ" )
14831483 self .assertEqual (blob .crc32c , "4gcgLQ" )
14841484
1485+ def test_download_as_string_w_hash_response_header_none (self ):
1486+ blob_name = "blob-name"
1487+ client = mock .Mock (spec = ["_http" ])
1488+ bucket = _Bucket (client )
1489+ media_link = "http://example.com/media/"
1490+ properties = {"mediaLink" : media_link }
1491+ blob = self ._make_one (blob_name , bucket = bucket , properties = properties )
1492+
1493+ response = self ._mock_requests_response (
1494+ http_client .OK ,
1495+ headers = {"X-Goog-Hash" : "" },
1496+ # { "x": 5 } gzipped
1497+ content = b"\x1f \x8b \x08 \x00 \xcf o\x17 _\x02 \xff \xab VP\xaa P\xb2 R0U\xa8 \x05 \x00 \xa1 \xca Q\x93 \n \x00 \x00 \x00 " ,
1498+ )
1499+ blob ._extract_headers_from_download (response )
1500+
1501+ self .assertIsNone (blob .md5_hash )
1502+ self .assertIsNone (blob .crc32c )
1503+
14851504 def test_download_as_string_w_generation_match (self ):
14861505 GENERATION_NUMBER = 6
14871506 MEDIA_LINK = "http://example.com/media/"
You can’t perform that action at this time.
0 commit comments