@@ -1035,13 +1035,12 @@ def test_blob_crc32_md5_hash(self):
1035
1035
self .assertEqual (download_blob .md5_hash , blob .md5_hash )
1036
1036
1037
1037
1038
- class TestUnicode (unittest .TestCase ):
1039
- @vpcsc_config .skip_if_inside_vpcsc
1038
+ class TestUnicode (TestStorageFiles ):
1040
1039
def test_fetch_object_and_check_content (self ):
1041
- client = storage .Client ()
1042
- bucket = client .bucket ("storage-library-test-bucket" )
1040
+ # Historical note: This test when originally written accessed public
1041
+ # files with Unicode names. These files are no longer available, so it
1042
+ # was rewritten to upload them first.
1043
1043
1044
- # Note: These files are public.
1045
1044
# Normalization form C: a single character for e-acute;
1046
1045
# URL should end with Cafe%CC%81
1047
1046
# Normalization Form D: an ASCII e followed by U+0301 combining
@@ -1050,10 +1049,15 @@ def test_fetch_object_and_check_content(self):
1050
1049
u"Caf\u00e9 " : b"Normalization Form C" ,
1051
1050
u"Cafe\u0301 " : b"Normalization Form D" ,
1052
1051
}
1052
+
1053
1053
for blob_name , file_contents in test_data .items ():
1054
- blob = bucket .blob (blob_name )
1055
- self .assertEqual (blob .name , blob_name )
1054
+ blob = self .bucket .blob (blob_name )
1055
+ blob .upload_from_string (file_contents )
1056
+
1057
+ for blob_name , file_contents in test_data .items ():
1058
+ blob = self .bucket .blob (blob_name )
1056
1059
self .assertEqual (blob .download_as_bytes (), file_contents )
1060
+ self .assertEqual (blob .name , blob_name )
1057
1061
1058
1062
1059
1063
class TestStorageListFiles (TestStorageFiles ):
0 commit comments