File tree Expand file tree Collapse file tree 2 files changed +9
-10
lines changed Expand file tree Collapse file tree 2 files changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -256,7 +256,8 @@ def _parse_atom_entry(entry):
256
256
'links' : links ,
257
257
'access' : metadata .access ,
258
258
'fields' : metadata .fields ,
259
- 'content' : content
259
+ 'content' : content ,
260
+ 'updated' : entry .get ("updated" )
260
261
})
261
262
262
263
Original file line number Diff line number Diff line change @@ -341,21 +341,19 @@ def test_setttl(self):
341
341
self .assertGreater (ttl , old_ttl )
342
342
343
343
def test_touch (self ):
344
- # This cannot be tested very fast. touch will reset the ttl to the
345
- # original value for the job, so first we have to wait just long enough
346
- # for the ttl to tick down. Its granularity is 1s, so we'll wait a
347
- # couple of seconds before we start.
348
344
while not self .job .is_done ():
349
345
pass
350
346
sleep (2 )
351
347
self .job .refresh ()
352
- old_ttl = int ( self .job [ 'ttl' ])
348
+ old_updated = self .job . state . updated
353
349
self .job .touch ()
350
+ sleep (2 )
354
351
self .job .refresh ()
355
- new_ttl = int (self .job ['ttl' ])
356
- if new_ttl == old_ttl :
357
- self .fail ("Didn't wait long enough for TTL to change and make touch meaningful." )
358
- self .assertGreater (int (self .job ['ttl' ]), old_ttl )
352
+ new_updated = self .job .state .updated
353
+
354
+ # Touch will increase the updated time
355
+ self .assertLess (old_updated , new_updated )
356
+
359
357
360
358
def test_search_invalid_query_as_json (self ):
361
359
args = {
You can’t perform that action at this time.
0 commit comments