Reorganize SWF tests so they're shorter and easier to use

This commit is contained in:
Jean-Baptiste Barth 2015-10-26 06:31:00 +01:00
commit eadc07bf61
14 changed files with 180 additions and 168 deletions

View file

@ -0,0 +1,26 @@
from sure import expect
from moto.swf.models import ActivityTask
from ..utils import make_workflow_execution
def test_activity_task_creation():
wfe = make_workflow_execution()
task = ActivityTask(
activity_id="my-activity-123",
activity_type="foo",
input="optional",
workflow_execution=wfe,
)
task.workflow_execution.should.equal(wfe)
task.state.should.equal("SCHEDULED")
task.task_token.should_not.be.empty
task.started_event_id.should.be.none
task.start(123)
task.state.should.equal("STARTED")
task.started_event_id.should.equal(123)
task.complete()
task.state.should.equal("COMPLETED")