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
|
|
@ -1,6 +1,8 @@
|
|||
from moto.swf.models import (
|
||||
ActivityType,
|
||||
Domain,
|
||||
WorkflowType,
|
||||
WorkflowExecution,
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -9,7 +11,7 @@ def get_basic_domain():
|
|||
return Domain("test-domain", "90")
|
||||
|
||||
|
||||
# A generic test WorkflowType
|
||||
# A test WorkflowType
|
||||
def _generic_workflow_type_attributes():
|
||||
return [
|
||||
"test-workflow", "v1.0"
|
||||
|
|
@ -28,3 +30,11 @@ def mock_basic_workflow_type(domain_name, conn):
|
|||
args, kwargs = _generic_workflow_type_attributes()
|
||||
conn.register_workflow_type(domain_name, *args, **kwargs)
|
||||
return conn
|
||||
|
||||
|
||||
# A test WorkflowExecution
|
||||
def make_workflow_execution(**kwargs):
|
||||
domain = get_basic_domain()
|
||||
domain.add_type(ActivityType("test-activity", "v1.1"))
|
||||
wft = get_basic_workflow_type()
|
||||
return WorkflowExecution(domain, wft, "ab1234", **kwargs)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue