summaryrefslogtreecommitdiff
path: root/test_joblib.py
diff options
context:
space:
mode:
Diffstat (limited to 'test_joblib.py')
-rw-r--r--test_joblib.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/test_joblib.py b/test_joblib.py
index 865cfab..1a760f8 100644
--- a/test_joblib.py
+++ b/test_joblib.py
@@ -49,6 +49,16 @@ class TestJoblib:
assert None == (await queue.acquire(jobtype="testing"))[1]
@pytest.mark.asyncio
+ async def test_request_and_acquire_batch(self, queue, payload):
+ # request should succeed
+ await queue.request(jobtype="testing", payload=[payload]*5)
+ # acquire should return same payload
+ for _ in range(5):
+ assert payload == (await queue.acquire(jobtype="testing"))[1]
+ # there should not be another job
+ assert None == (await queue.acquire(jobtype="testing"))[1]
+
+ @pytest.mark.asyncio
async def test_cleanup(self, queue, payload):
await queue.request(jobtype="testing", payload=payload)
# mark job as processing