| 1 |
import operator |
| 2 |
|
| 3 |
import pytest |
| 4 |
|
| 5 |
from celery.utils.functional import noop |
| 6 |
|
| 7 |
|
| 8 |
class test_thread_TaskPool: |
| 9 |
|
| 10 |
def test_on_apply(self): |
| 11 |
from celery.concurrency import thread |
| 12 |
x = thread.TaskPool() |
| 13 |
try: |
| 14 |
x.on_apply(operator.add, (2, 2), {}, noop, noop) |
| 15 |
finally: |
| 16 |
x.stop() |
| 17 |
|
| 18 |
def test_info(self): |
| 19 |
from celery.concurrency import thread |
| 20 |
x = thread.TaskPool() |
| 21 |
try: |
| 22 |
assert x.info |
| 23 |
finally: |
| 24 |
x.stop() |
| 25 |
|
| 26 |
def test_on_stop(self): |
| 27 |
from celery.concurrency import thread |
| 28 |
x = thread.TaskPool() |
| 29 |
x.on_stop() |
| 30 |
with pytest.raises(RuntimeError): |
| 31 |
x.on_apply(operator.add, (2, 2), {}, noop, noop) |