Skip to content

Commit

Permalink
Minor cleanup to test_workflow_conductor_data_flow
Browse files Browse the repository at this point in the history
  • Loading branch information
m4dcoder committed Apr 15, 2020
1 parent 2de6ee7 commit 4bc5575
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

class WorkflowConductorDataFlowTest(test_base.WorkflowConductorTest):

WF_DEF_YAQL = """
wf_def_yaql = """
version: 1.0
description: A basic sequential workflow.
Expand Down Expand Up @@ -61,7 +61,7 @@ class WorkflowConductorDataFlowTest(test_base.WorkflowConductorTest):
action: core.noop
"""

WF_DEF_JSON = """
wf_def_jinja = """
version: 1.0
description: A basic sequential workflow.
Expand Down Expand Up @@ -97,8 +97,8 @@ class WorkflowConductorDataFlowTest(test_base.WorkflowConductorTest):
action: core.noop
"""

def _prep_conductor(self, context=None, inputs=None, status=None, wf_def=None):
spec = native_specs.WorkflowSpec(wf_def or self.WF_DEF_YAQL)
def _prep_conductor(self, wf_def, context=None, inputs=None, status=None):
spec = native_specs.WorkflowSpec(wf_def)
self.assertDictEqual(spec.inspect(), {})

kwargs = {
Expand Down Expand Up @@ -135,13 +135,13 @@ def _get_combined_value(self, callstack_depth=0):
def _assert_data_flow(self, inputs, expected_output):
# This assert method checks input value would be handled and published
# as an expected type and value with both YAQL and Jinja expressions.
for wf_def in [self.WF_DEF_JSON, self.WF_DEF_YAQL]:
conductor = self._prep_conductor(inputs=inputs, status=statuses.RUNNING, wf_def=wf_def)
for wf_def in [self.wf_def_jinja, self.wf_def_yaql]:
conductor = self._prep_conductor(wf_def, inputs=inputs, status=statuses.RUNNING)

for i in range(1, len(conductor.spec.tasks) + 1):
task_name = 'task' + str(i)
self.forward_task_statuses(conductor, task_name,
[statuses.RUNNING, statuses.SUCCEEDED])
forward_statuses = [statuses.RUNNING, statuses.SUCCEEDED]
self.forward_task_statuses(conductor, task_name, forward_statuses)

# Render workflow output and checkout workflow status and output.
conductor.render_workflow_output()
Expand Down

0 comments on commit 4bc5575

Please sign in to comment.