Пример #1
0
def spawn_fan(pnode, wid, fan, depth):
    if depth == 0:
        return
    for _ in range(fan):
        node = WorkflowJobTemplateNode()
        node.unified_job_template_id = 10
        node.workflow_job_template_id = wid
        node.save()
        pnode.success_nodes.add(node)
        spawn_fan(node, wid, fan, depth - 1)
    pnode.save()
Пример #2
0
def spawn_workflow_fan(depth, fan):
    w = WorkflowJobTemplate()
    w.name = "w2"
    w.save()

    node = WorkflowJobTemplateNode()
    node.unified_job_template_id = 10
    node.workflow_job_template_id = w.id
    node.save()

    w.workflow_job_template_nodes.add(node)
    w.save()

    spawn_fan(node, w.id, fan, depth)
Пример #3
0
def spawn_workflow(num):
    w = WorkflowJobTemplate()
    w.name = "w1"
    w.save()
    prev_node = None
    for _ in range(num):
        node = WorkflowJobTemplateNode()
        # 10 was a job template I had created previously
        node.unified_job_template_id = 10
        node.workflow_job_template_id = w.id
        node.save()
        if prev_node:
            prev_node.success_nodes.add(node)
            prev_node.save()
        else:
            w.workflow_job_template_nodes.add(node)
            w.save()
        prev_node = node
Пример #4
0
 def job_template_nodes(self):
     return [WorkflowJobTemplateNode(id=i) for i in range(0, 20)]
Пример #5
0
 def job_template_nodes(self, job_templates):
     return [
         WorkflowJobTemplateNode(unified_job_template=job_templates[i])
         for i in range(0, 10)
     ]
Пример #6
0
def test_node_getter_and_setters():
    node = WorkflowJobTemplateNode()
    node.job_type = 'check'
    assert node.char_prompts['job_type'] == 'check'
    assert node.job_type == 'check'
Пример #7
0
def wfjt_node_no_prompts(workflow_job_template_unit, jt_ask):
    node = WorkflowJobTemplateNode(
        workflow_job_template=workflow_job_template_unit,
        unified_job_template=jt_ask)
    return node