예제 #1
0
 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()
예제 #2
0
 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)
예제 #3
0
 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()