31 lines
656 B
Python
31 lines
656 B
Python
from _operator import itemgetter
|
|
|
|
import pytest
|
|
|
|
from pyinfra.queue.consumer import Consumer
|
|
|
|
|
|
@pytest.fixture(scope="session")
|
|
def consumer(queue_manager, callback):
|
|
return Consumer(callback, queue_manager)
|
|
|
|
|
|
@pytest.fixture(scope="session")
|
|
def access_callback():
|
|
return itemgetter("fileId")
|
|
|
|
|
|
@pytest.fixture()
|
|
def items():
|
|
def inner():
|
|
for i in range(3):
|
|
body = {
|
|
"dossierId": "folder",
|
|
"fileId": f"file{i}",
|
|
"targetFileExtension": "in.gz",
|
|
"responseFileExtension": "out.gz",
|
|
}
|
|
yield f"{i}".encode(), body
|
|
|
|
return list(inner())
|