File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change 9696 "contentLanguage" ,
9797 _CONTENT_TYPE_FIELD ,
9898 "crc32c" ,
99+ "customTime" ,
99100 "md5Hash" ,
100101 "metadata" ,
101102 "name" ,
@@ -1530,6 +1531,7 @@ def _get_writable_metadata(self):
15301531 * ``contentLanguage``
15311532 * ``contentType``
15321533 * ``crc32c``
1534+ * ``customTime``
15331535 * ``md5Hash``
15341536 * ``metadata``
15351537 * ``name``
Original file line number Diff line number Diff line change @@ -1027,6 +1027,19 @@ def test_upload_blob_owner(self):
10271027 owner = same_blob .owner
10281028 self .assertIn (user_email , owner ["entity" ])
10291029
1030+ def test_upload_blob_custom_time (self ):
1031+ blob = self .bucket .blob ("CustomTimeBlob" )
1032+ file_contents = b"Hello World"
1033+ current_time = datetime .datetime .now ()
1034+ blob .custom_time = current_time
1035+ blob .upload_from_string (file_contents )
1036+ self .case_blobs_to_delete .append (blob )
1037+
1038+ same_blob = self .bucket .blob ("CustomTimeBlob" )
1039+ same_blob .reload (projection = "full" )
1040+ custom_time = same_blob .custom_time .replace (tzinfo = None )
1041+ self .assertEqual (custom_time , current_time )
1042+
10301043 def test_blob_crc32_md5_hash (self ):
10311044 blob = self .bucket .blob ("MyBuffer" )
10321045 file_contents = b"Hello World"
You can’t perform that action at this time.
0 commit comments