def test_next(self): jq = JobQueue(self.db) self.assertRaises(Exception, jq.next) job = {'message': 'hello world!'} jq.pub(job) row = jq.next() self.assertEquals(row['data']['message'], 'hello world!') jq.clear_queue()
def test_next(self): jq = JobQueue(self.db, collection_name=K.collection) self.assertRaises(Exception, jq.next) job = {'message': 'hello world!'} jq.pub(job) row = jq.next() self.assertEquals(row['data']['message'], 'hello world!') self.assertEquals(jq.queue_count(), 0)