diff --git a/crc/scripts/FactService.py b/crc/scripts/FactService.py index 64424d45..57d9e19c 100644 --- a/crc/scripts/FactService.py +++ b/crc/scripts/FactService.py @@ -17,14 +17,14 @@ class FactService: return response.json()['value'] def do_task(self, task, **kwargs): - if "Fact.type" not in task.data: + print(task.data) + + if "type" not in task.data: raise Exception("No Fact Provided.") else: - fact = task.data["Fact.type"] + fact = task.data["type"] - if True: - details = "Assertively Incubate Seamless Niches" - elif fact == "cat": + if fact == "cat": details = self.get_cat() elif fact == "norris": details = self.get_norris() @@ -32,4 +32,7 @@ class FactService: details = self.get_buzzword() else: details = "unknown fact type." + task.data['details'] = details + print(details) + return details diff --git a/tests/test_workflow_processor.py b/tests/test_workflow_processor.py index 7f39279c..288e4281 100644 --- a/tests/test_workflow_processor.py +++ b/tests/test_workflow_processor.py @@ -38,7 +38,7 @@ class TestWorkflowProcessor(BaseTest): self.assertEqual(1, len(next_user_tasks)) task = next_user_tasks[0] self.assertEqual("Task_User_Select_Type", task.get_name()) - model = {"Fact.type": "buzzword"} + model = {"type": "buzzword"} if task.data is None: task.data = {} task.data.update(model)