File tree 2 files changed +15
-0
lines changed
2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change 96
96
"contentLanguage" ,
97
97
_CONTENT_TYPE_FIELD ,
98
98
"crc32c" ,
99
+ "customTime" ,
99
100
"md5Hash" ,
100
101
"metadata" ,
101
102
"name" ,
@@ -1530,6 +1531,7 @@ def _get_writable_metadata(self):
1530
1531
* ``contentLanguage``
1531
1532
* ``contentType``
1532
1533
* ``crc32c``
1534
+ * ``customTime``
1533
1535
* ``md5Hash``
1534
1536
* ``metadata``
1535
1537
* ``name``
Original file line number Diff line number Diff line change @@ -1027,6 +1027,19 @@ def test_upload_blob_owner(self):
1027
1027
owner = same_blob .owner
1028
1028
self .assertIn (user_email , owner ["entity" ])
1029
1029
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
+
1030
1043
def test_blob_crc32_md5_hash (self ):
1031
1044
blob = self .bucket .blob ("MyBuffer" )
1032
1045
file_contents = b"Hello World"
You can’t perform that action at this time.
0 commit comments