worker.work() should be tested with burst=True

This commit is contained in:
Selwin Ong 2020-06-07 18:09:17 +07:00
parent 29222ea12f
commit a1ee466882
1 changed files with 2 additions and 2 deletions

View File

@ -111,13 +111,13 @@ class TestWorker(RQTestCase):
fooq, barq = Queue('foo'), Queue('bar') fooq, barq = Queue('foo'), Queue('bar')
w = Worker([fooq, barq]) w = Worker([fooq, barq])
self.assertEqual( self.assertEqual(
w.work(burst=True), False, w.work(burst=True, with_scheduler=True), False,
'Did not expect any work on the queue.' 'Did not expect any work on the queue.'
) )
fooq.enqueue(say_hello, name='Frank') fooq.enqueue(say_hello, name='Frank')
self.assertEqual( self.assertEqual(
w.work(burst=True), True, w.work(burst=True, with_scheduler=True), True,
'Expected at least some work done.' 'Expected at least some work done.'
) )