fmartingr
/
jeeves
Archived
1
0
Fork 0
This repository has been archived on 2021-02-14. You can view files and clone it, but cannot push or open issues or pull requests.
jeeves/jeeves/core/tests/factories.py

22 lines
510 B
Python

import factory
from jeeves.core.objects import Flow, Task
from jeeves.core.registry import ActionRegistry
class TaskFactory(factory.Factory):
name = factory.Faker("name")
type = factory.Iterator(ActionRegistry.actions)
parameters = {"script": "#!/bin/bash\necho test"}
class Meta:
model = Task
class FlowFactory(factory.Factory):
name = factory.Faker("name")
tasks = factory.LazyFunction(lambda: [TaskFactory() for _ in range(0, 2)])
class Meta:
model = Flow