Rework task lists for activity/decision tasks
This commit is contained in:
parent
83c08b7655
commit
be71909a8c
4 changed files with 72 additions and 18 deletions
|
|
@ -21,9 +21,28 @@ def test_domain_string_representation():
|
|||
domain = Domain("my-domain", "60")
|
||||
str(domain).should.equal("Domain(name: my-domain, status: REGISTERED)")
|
||||
|
||||
def test_domain_add_to_task_list():
|
||||
def test_domain_add_to_activity_task_list():
|
||||
domain = Domain("my-domain", "60")
|
||||
domain.add_to_task_list("foo", "bar")
|
||||
dict(domain.task_lists).should.equal({
|
||||
domain.add_to_activity_task_list("foo", "bar")
|
||||
domain.activity_task_lists.should.equal({
|
||||
"foo": ["bar"]
|
||||
})
|
||||
|
||||
def test_domain_activity_tasks():
|
||||
domain = Domain("my-domain", "60")
|
||||
domain.add_to_activity_task_list("foo", "bar")
|
||||
domain.add_to_activity_task_list("other", "baz")
|
||||
domain.activity_tasks.should.equal(["bar", "baz"])
|
||||
|
||||
def test_domain_add_to_decision_task_list():
|
||||
domain = Domain("my-domain", "60")
|
||||
domain.add_to_decision_task_list("foo", "bar")
|
||||
domain.decision_task_lists.should.equal({
|
||||
"foo": ["bar"]
|
||||
})
|
||||
|
||||
def test_domain_decision_tasks():
|
||||
domain = Domain("my-domain", "60")
|
||||
domain.add_to_decision_task_list("foo", "bar")
|
||||
domain.add_to_decision_task_list("other", "baz")
|
||||
domain.decision_tasks.should.equal(["bar", "baz"])
|
||||
|
|
|
|||
|
|
@ -207,7 +207,7 @@ def test_workflow_execution_schedule_activity_task():
|
|||
task = wfe.activity_tasks[0]
|
||||
task.activity_id.should.equal("my-activity-001")
|
||||
task.activity_type.name.should.equal("test-activity")
|
||||
wfe.domain.task_lists["task-list-name"].should.contain(task)
|
||||
wfe.domain.activity_task_lists["task-list-name"].should.contain(task)
|
||||
|
||||
def test_workflow_execution_schedule_activity_task_without_task_list_should_take_default():
|
||||
wfe = make_workflow_execution()
|
||||
|
|
@ -229,7 +229,7 @@ def test_workflow_execution_schedule_activity_task_without_task_list_should_take
|
|||
last_event.task_list.should.equal("foobar")
|
||||
|
||||
task = wfe.activity_tasks[0]
|
||||
wfe.domain.task_lists["foobar"].should.contain(task)
|
||||
wfe.domain.activity_task_lists["foobar"].should.contain(task)
|
||||
|
||||
def test_workflow_execution_schedule_activity_task_should_fail_if_wrong_attributes():
|
||||
wfe = make_workflow_execution()
|
||||
|
|
@ -286,7 +286,7 @@ def test_workflow_execution_schedule_activity_task_should_fail_if_wrong_attribut
|
|||
|
||||
wfe.open_counts["openActivityTasks"].should.equal(0)
|
||||
wfe.activity_tasks.should.have.length_of(0)
|
||||
wfe.domain.task_lists.should.have.length_of(0)
|
||||
wfe.domain.activity_task_lists.should.have.length_of(0)
|
||||
|
||||
hsh["heartbeatTimeout"] = "300"
|
||||
wfe.schedule_activity_task(123, hsh)
|
||||
|
|
@ -294,7 +294,7 @@ def test_workflow_execution_schedule_activity_task_should_fail_if_wrong_attribut
|
|||
last_event.event_type.should.equal("ActivityTaskScheduled")
|
||||
|
||||
task = wfe.activity_tasks[0]
|
||||
wfe.domain.task_lists["foobar"].should.contain(task)
|
||||
wfe.domain.activity_task_lists["foobar"].should.contain(task)
|
||||
wfe.open_counts["openDecisionTasks"].should.equal(0)
|
||||
wfe.open_counts["openActivityTasks"].should.equal(1)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue