Fix indentation and newlines according to flake8

main
Arnold Krille 9 years ago
parent c6765e12ff
commit 9df0a853d8

@ -242,14 +242,14 @@ class TestQueue(RQTestCase):
self.assertEqual(job.func, say_hello) self.assertEqual(job.func, say_hello)
self.assertEqual(job.origin, fooq.name) self.assertEqual(job.origin, fooq.name)
self.assertEqual(job.args[0], 'for Foo', self.assertEqual(job.args[0], 'for Foo',
'Foo should be dequeued first.') 'Foo should be dequeued first.')
job, queue = Queue.dequeue_any([fooq, barq], None) job, queue = Queue.dequeue_any([fooq, barq], None)
self.assertEqual(queue, barq) self.assertEqual(queue, barq)
self.assertEqual(job.func, say_hello) self.assertEqual(job.func, say_hello)
self.assertEqual(job.origin, barq.name) self.assertEqual(job.origin, barq.name)
self.assertEqual(job.args[0], 'for Bar', self.assertEqual(job.args[0], 'for Bar',
'Bar should be dequeued second.') 'Bar should be dequeued second.')
def test_dequeue_any_ignores_nonexisting_jobs(self): def test_dequeue_any_ignores_nonexisting_jobs(self):
"""Dequeuing (from any queue) silently ignores non-existing jobs.""" """Dequeuing (from any queue) silently ignores non-existing jobs."""
@ -355,7 +355,6 @@ class TestQueue(RQTestCase):
# DeferredJobRegistry should also be empty # DeferredJobRegistry should also be empty
self.assertEqual(registry.get_job_ids(), []) self.assertEqual(registry.get_job_ids(), [])
def test_enqueue_dependents_on_multiple_queues(self): def test_enqueue_dependents_on_multiple_queues(self):
"""Enqueueing dependent jobs on multiple queues pushes jobs in the queues """Enqueueing dependent jobs on multiple queues pushes jobs in the queues
and removes them from DeferredJobRegistry for each different queue.""" and removes them from DeferredJobRegistry for each different queue."""
@ -392,8 +391,6 @@ class TestQueue(RQTestCase):
self.assertEqual(registry_1.get_job_ids(), []) self.assertEqual(registry_1.get_job_ids(), [])
self.assertEqual(registry_2.get_job_ids(), []) self.assertEqual(registry_2.get_job_ids(), [])
def test_enqueue_job_with_dependency(self): def test_enqueue_job_with_dependency(self):
"""Jobs are enqueued only when their dependencies are finished.""" """Jobs are enqueued only when their dependencies are finished."""
# Job with unfinished dependency is not immediately enqueued # Job with unfinished dependency is not immediately enqueued

@ -83,11 +83,11 @@ 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(w.work(burst=True), False, self.assertEqual(w.work(burst=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(w.work(burst=True), True, self.assertEqual(w.work(burst=True), True,
'Expected at least some work done.') 'Expected at least some work done.')
def test_worker_ttl(self): def test_worker_ttl(self):
"""Worker ttl.""" """Worker ttl."""
@ -103,7 +103,7 @@ class TestWorker(RQTestCase):
w = Worker([q]) w = Worker([q])
job = q.enqueue('tests.fixtures.say_hello', name='Frank') job = q.enqueue('tests.fixtures.say_hello', name='Frank')
self.assertEqual(w.work(burst=True), True, self.assertEqual(w.work(burst=True), True,
'Expected at least some work done.') 'Expected at least some work done.')
self.assertEqual(job.result, 'Hi there, Frank!') self.assertEqual(job.result, 'Hi there, Frank!')
def test_job_times(self): def test_job_times(self):
@ -117,7 +117,7 @@ class TestWorker(RQTestCase):
self.assertIsNone(job.started_at) self.assertIsNone(job.started_at)
self.assertIsNone(job.ended_at) self.assertIsNone(job.ended_at)
self.assertEqual(w.work(burst=True), True, self.assertEqual(w.work(burst=True), True,
'Expected at least some work done.') 'Expected at least some work done.')
self.assertEqual(job.result, 'Hi there, Stranger!') self.assertEqual(job.result, 'Hi there, Stranger!')
after = utcnow() after = utcnow()
job.refresh() job.refresh()

Loading…
Cancel
Save