26 lines
601 B
Python
26 lines
601 B
Python
from jeeves.core.objects import BaseObject
|
|
from jeeves.core.parsers import FlowParser
|
|
from .factories import FlowFactory
|
|
|
|
EXPORTED_FLOW = {
|
|
"name": "Test",
|
|
"tasks": [
|
|
{
|
|
"type": "jeeves.core.actions.stub:StubSuccessfulAction",
|
|
"name": "Test Action",
|
|
"parameters": {},
|
|
}
|
|
],
|
|
}
|
|
|
|
|
|
def test_parser_object_to_dict_ok():
|
|
obj = FlowFactory()
|
|
result = FlowParser.to_dict(obj)
|
|
obj = FlowParser.from_dict(result)
|
|
|
|
|
|
def test_parser_dict_to_object_ok():
|
|
obj = FlowParser.from_dict(EXPORTED_FLOW)
|
|
assert isinstance(obj, BaseObject)
|