2022-04-10 04:45:10 +00:00
|
|
|
from bopytex.planner import fake_planner
|
|
|
|
from bopytex.service import orcherstrator
|
|
|
|
from bopytex.tasks import Task
|
2022-04-13 13:09:08 +00:00
|
|
|
from bopytex.worker import Dispatcher
|
|
|
|
from .fakes.workers import fake_worker
|
2022-04-09 05:30:13 +00:00
|
|
|
|
|
|
|
|
2022-04-10 04:45:10 +00:00
|
|
|
def test_service():
|
|
|
|
options = {"quantity": 3, "template": "tpl_src.tex"}
|
2022-04-10 12:37:19 +00:00
|
|
|
dispatcher = Dispatcher(actions={"DO": fake_worker})
|
|
|
|
|
|
|
|
service = orcherstrator(options, fake_planner.simple, dispatcher)
|
|
|
|
|
2022-04-13 13:09:08 +00:00
|
|
|
for i, message in enumerate(service):
|
|
|
|
assert message.status == 0
|
|
|
|
assert message.out == [f"FAKE - {{'number': {i}}} - [] - {i}"]
|