@@ -215,6 +215,9 @@ def test_download_to_file(self):
215215
216216 def test_download_to_filename (self ):
217217 import httplib
218+ import os
219+ import time
220+ import datetime
218221 from tempfile import NamedTemporaryFile
219222 KEY = 'key'
220223 chunk1_response = {'status' : httplib .PARTIAL_CONTENT ,
@@ -227,15 +230,23 @@ def test_download_to_filename(self):
227230 )
228231 bucket = _Bucket (connection )
229232 MEDIA_LINK = 'http://example.com/media/'
230- properties = {'mediaLink' : MEDIA_LINK }
233+ properties = {'mediaLink' : MEDIA_LINK ,
234+ 'updated' : '2014-12-06T13:13:50.690Z' }
231235 key = self ._makeOne (bucket , KEY , properties )
232236 key .CHUNK_SIZE = 3
233237 with NamedTemporaryFile () as f :
234238 key .download_to_filename (f .name )
235239 f .flush ()
236240 with open (f .name ) as g :
237241 wrote = g .read ()
242+ mtime = os .path .getmtime (f .name )
243+ updatedTime = time .mktime (
244+ datetime .datetime .strptime (
245+ key .properties ['updated' ],
246+ '%Y-%m-%dT%H:%M:%S.%fz' ).timetuple ()
247+ )
238248 self .assertEqual (wrote , 'abcdef' )
249+ self .assertEqual (mtime , updatedTime )
239250
240251 def test_download_as_string (self ):
241252 import httplib
0 commit comments