Skip to content

Commit 6f865d9

Browse files
authored
fix: self-upload files for Unicode system test (#296)
1 parent fcd1c4f commit 6f865d9

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

tests/system/test_system.py

+11-7
Original file line numberDiff line numberDiff line change
@@ -1035,13 +1035,12 @@ def test_blob_crc32_md5_hash(self):
10351035
self.assertEqual(download_blob.md5_hash, blob.md5_hash)
10361036

10371037

1038-
class TestUnicode(unittest.TestCase):
1039-
@vpcsc_config.skip_if_inside_vpcsc
1038+
class TestUnicode(TestStorageFiles):
10401039
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.
10431043

1044-
# Note: These files are public.
10451044
# Normalization form C: a single character for e-acute;
10461045
# URL should end with Cafe%CC%81
10471046
# Normalization Form D: an ASCII e followed by U+0301 combining
@@ -1050,10 +1049,15 @@ def test_fetch_object_and_check_content(self):
10501049
u"Caf\u00e9": b"Normalization Form C",
10511050
u"Cafe\u0301": b"Normalization Form D",
10521051
}
1052+
10531053
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)
10561059
self.assertEqual(blob.download_as_bytes(), file_contents)
1060+
self.assertEqual(blob.name, blob_name)
10571061

10581062

10591063
class TestStorageListFiles(TestStorageFiles):

0 commit comments

Comments
 (0)