@@ -125,12 +125,12 @@ def test_generate_signed_url_w_default_method(self):
125125 from gcloud .storage import blob as MUT
126126
127127 BLOB_NAME = 'blob-name'
128- EXPIRATION = '2014-10-16T20:34:37Z '
128+ EXPIRATION = '2014-10-16T20:34:37.000Z '
129129 connection = _Connection ()
130130 bucket = _Bucket (connection )
131131 blob = self ._makeOne (BLOB_NAME , bucket = bucket )
132132 URI = ('http://example.com/abucket/a-blob-name?Signature=DEADBEEF'
133- '&Expiration=2014-10-16T20:34:37Z ' )
133+ '&Expiration=2014-10-16T20:34:37.000Z ' )
134134
135135 SIGNER = _Signer ()
136136 with _Monkey (MUT , generate_signed_url = SIGNER ):
@@ -151,12 +151,12 @@ def test_generate_signed_url_w_slash_in_name(self):
151151 from gcloud .storage import blob as MUT
152152
153153 BLOB_NAME = 'parent/child'
154- EXPIRATION = '2014-10-16T20:34:37Z '
154+ EXPIRATION = '2014-10-16T20:34:37.000Z '
155155 connection = _Connection ()
156156 bucket = _Bucket (connection )
157157 blob = self ._makeOne (BLOB_NAME , bucket = bucket )
158158 URI = ('http://example.com/abucket/a-blob-name?Signature=DEADBEEF'
159- '&Expiration=2014-10-16T20:34:37Z ' )
159+ '&Expiration=2014-10-16T20:34:37.000Z ' )
160160
161161 SIGNER = _Signer ()
162162 with _Monkey (MUT , generate_signed_url = SIGNER ):
@@ -176,12 +176,12 @@ def test_generate_signed_url_w_explicit_method(self):
176176 from gcloud .storage import blob as MUT
177177
178178 BLOB_NAME = 'blob-name'
179- EXPIRATION = '2014-10-16T20:34:37Z '
179+ EXPIRATION = '2014-10-16T20:34:37.000Z '
180180 connection = _Connection ()
181181 bucket = _Bucket (connection )
182182 blob = self ._makeOne (BLOB_NAME , bucket = bucket )
183183 URI = ('http://example.com/abucket/a-blob-name?Signature=DEADBEEF'
184- '&Expiration=2014-10-16T20:34:37Z ' )
184+ '&Expiration=2014-10-16T20:34:37.000Z ' )
185185
186186 SIGNER = _Signer ()
187187 with _Monkey (MUT , generate_signed_url = SIGNER ):
@@ -990,22 +990,36 @@ def test_storage_class(self):
990990 self .assertEqual (blob .storage_class , STORAGE_CLASS )
991991
992992 def test_time_deleted (self ):
993+ import datetime
993994 BLOB_NAME = 'blob-name'
994995 connection = _Connection ()
995996 bucket = _Bucket (connection )
996- TIME_DELETED = '2014-11-05T20:34:37Z'
997+ TIME_DELETED = '2014-11-05T20:34:37.000Z'
998+ TIMESTAMP = datetime .datetime (2014 , 11 , 5 , 20 , 34 , 37 )
997999 properties = {'timeDeleted' : TIME_DELETED }
9981000 blob = self ._makeOne (BLOB_NAME , bucket = bucket , properties = properties )
999- self .assertEqual (blob .time_deleted , TIME_DELETED )
1001+ self .assertEqual (blob .time_deleted , TIMESTAMP )
1002+
1003+ def test_time_deleted_unset (self ):
1004+ BUCKET = object ()
1005+ blob = self ._makeOne ('blob-name' , bucket = BUCKET )
1006+ self .assertEqual (blob .time_deleted , None )
10001007
10011008 def test_updated (self ):
1009+ import datetime
10021010 BLOB_NAME = 'blob-name'
10031011 connection = _Connection ()
10041012 bucket = _Bucket (connection )
1005- UPDATED = '2014-11-05T20:34:37Z'
1013+ UPDATED = '2014-11-05T20:34:37.000Z'
1014+ TIMESTAMP = datetime .datetime (2014 , 11 , 5 , 20 , 34 , 37 )
10061015 properties = {'updated' : UPDATED }
10071016 blob = self ._makeOne (BLOB_NAME , bucket = bucket , properties = properties )
1008- self .assertEqual (blob .updated , UPDATED )
1017+ self .assertEqual (blob .updated , TIMESTAMP )
1018+
1019+ def test_updated_unset (self ):
1020+ BUCKET = object ()
1021+ blob = self ._makeOne ('blob-name' , bucket = BUCKET )
1022+ self .assertEqual (blob .updated , None )
10091023
10101024
10111025class _Responder (object ):
0 commit comments