Make workflow_id a required property of WorkflowExecution

Given the response of DescribeWorkflowExecution endpoint, the
WorkflowExecution has to know about its own workflowId.
This commit is contained in:
Jean-Baptiste Barth 2015-10-02 09:41:29 +02:00
commit a589dc08b5
2 changed files with 15 additions and 12 deletions

View file

@ -77,15 +77,15 @@ def test_type_string_representation():
# WorkflowExecution
def test_workflow_execution_creation():
wfe = WorkflowExecution("workflow_type_whatever", child_policy="TERMINATE")
wfe = WorkflowExecution("workflow_type_whatever", "ab1234", child_policy="TERMINATE")
wfe.workflow_type.should.equal("workflow_type_whatever")
wfe.child_policy.should.equal("TERMINATE")
def test_workflow_execution_string_representation():
wfe = WorkflowExecution("workflow_type_whatever", child_policy="TERMINATE")
wfe = WorkflowExecution("workflow_type_whatever", "ab1234", child_policy="TERMINATE")
str(wfe).should.match(r"^WorkflowExecution\(run_id: .*\)")
def test_workflow_execution_generates_a_random_run_id():
wfe1 = WorkflowExecution("workflow_type_whatever")
wfe2 = WorkflowExecution("workflow_type_whatever")
wfe1 = WorkflowExecution("workflow_type_whatever", "ab1234")
wfe2 = WorkflowExecution("workflow_type_whatever", "ab1235")
wfe1.run_id.should_not.equal(wfe2.run_id)