<s> from mrq . job import Job <EOL> from mrq . queue import Queue <EOL> from datetime import datetime <EOL> from datetime import timedelta <EOL> def test_abort ( worker ) : <EOL> worker . start ( ) <EOL> worker . send_task ( "<STR_LIT>" , { "<STR_LIT:a>" : <NUM_LIT> } , accept_statuses = [ "<STR_LIT>" ] ) <EOL> assert Queue ( "<STR_LIT:default>" ) . size ( ) == <NUM_LIT:0> <EOL> db_jobs = list ( worker . mongodb_jobs . mrq_jobs . find ( ) ) <EOL> assert len ( db_jobs ) == <NUM_LIT:1> <EOL> job = db_jobs [ <NUM_LIT:0> ] <EOL> assert job [ "<STR_LIT:status>" ] == "<STR_LIT>" <EOL> assert job . get ( "<STR_LIT>" ) is not None <EOL> assert job [ "<STR_LIT>" ] < datetime . utcnow ( ) + timedelta ( hours = <NUM_LIT> ) </s>
