Reorganize SWF tests so they're shorter and easier to use
This commit is contained in:
parent
a713005882
commit
eadc07bf61
14 changed files with 180 additions and 168 deletions
26
tests/test_swf/models/test_activity_task.py
Normal file
26
tests/test_swf/models/test_activity_task.py
Normal 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")
|
||||
Loading…
Add table
Add a link
Reference in a new issue