fmartingr
/
jeeves
Archived
1
0
Fork 0

Fixed tests

This commit is contained in:
Felipe Martin 2020-03-04 22:37:55 +01:00
parent bfa86694ce
commit 2487078c8e
Signed by: fmartingr
GPG Key ID: 716BC147715E716F
5 changed files with 8 additions and 6 deletions

View File

@ -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

View File

View File

@ -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

View File

@ -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)))