Fixed tests
This commit is contained in:
parent
bfa86694ce
commit
2487078c8e
|
@ -16,4 +16,7 @@ class Action:
|
|||
|
||||
@abstractmethod
|
||||
def execute(self, workspace, **kwargs):
|
||||
"""
|
||||
Main method to override that handles the work for the defining action.
|
||||
"""
|
||||
pass
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
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"}
|
||||
type = "jeeves.core.actions.stub:StubSuccessAction"
|
||||
parameters = {}
|
||||
|
||||
class Meta:
|
||||
model = Task
|
||||
|
|
|
@ -24,7 +24,7 @@ EXPORTED_FLOW = {
|
|||
def test_parser_object_to_dict_ok():
|
||||
obj: Flow = FlowFactory()
|
||||
result = FlowParser.to_dict(obj)
|
||||
assert set(obj.fields).issubset(set(result))
|
||||
assert set(obj.dict()).issuperset(set(result))
|
||||
|
||||
|
||||
def test_parser_dict_to_object_ok():
|
||||
|
@ -53,7 +53,7 @@ def test_parser_json_file_to_object_ok():
|
|||
def test_parser_obj_to_json_ok():
|
||||
obj: Flow = FlowFactory()
|
||||
result = FlowParser.to_json(obj)
|
||||
assert set(obj.fields).issubset(set(json.loads(result)))
|
||||
assert set(obj.dict()).issuperset(set(json.loads(result)))
|
||||
|
||||
|
||||
########
|
||||
|
@ -77,4 +77,4 @@ def test_parser_toml_file_to_object_ok():
|
|||
def test_parser_obj_to_toml_ok():
|
||||
obj: Flow = FlowFactory()
|
||||
result = FlowParser.to_toml(obj)
|
||||
assert set(obj.fields).issubset(set(toml.loads(result)))
|
||||
assert set(obj.dict()).issuperset(set(toml.loads(result)))
|
||||
|
|
Reference in New Issue