Run black on moto & test directories.
This commit is contained in:
parent
c820395dbf
commit
96e5b1993d
507 changed files with 52541 additions and 47814 deletions
|
|
@ -1,11 +1,6 @@
|
|||
import boto
|
||||
|
||||
from moto.swf.models import (
|
||||
ActivityType,
|
||||
Domain,
|
||||
WorkflowType,
|
||||
WorkflowExecution,
|
||||
)
|
||||
from moto.swf.models import ActivityType, Domain, WorkflowType, WorkflowExecution
|
||||
|
||||
|
||||
# Some useful constants
|
||||
|
|
@ -13,9 +8,9 @@ from moto.swf.models import (
|
|||
# from semi-real world example, the goal is mostly to have predictible and
|
||||
# intuitive behaviour in moto/swf own tests...
|
||||
ACTIVITY_TASK_TIMEOUTS = {
|
||||
"heartbeatTimeout": "300", # 5 mins
|
||||
"heartbeatTimeout": "300", # 5 mins
|
||||
"scheduleToStartTimeout": "1800", # 30 mins
|
||||
"startToCloseTimeout": "1800", # 30 mins
|
||||
"startToCloseTimeout": "1800", # 30 mins
|
||||
"scheduleToCloseTimeout": "2700", # 45 mins
|
||||
}
|
||||
|
||||
|
|
@ -26,11 +21,12 @@ SCHEDULE_ACTIVITY_TASK_DECISION = {
|
|||
"activityId": "my-activity-001",
|
||||
"activityType": {"name": "test-activity", "version": "v1.1"},
|
||||
"taskList": {"name": "activity-task-list"},
|
||||
}
|
||||
},
|
||||
}
|
||||
for key, value in ACTIVITY_TASK_TIMEOUTS.items():
|
||||
SCHEDULE_ACTIVITY_TASK_DECISION[
|
||||
"scheduleActivityTaskDecisionAttributes"][key] = value
|
||||
SCHEDULE_ACTIVITY_TASK_DECISION["scheduleActivityTaskDecisionAttributes"][
|
||||
key
|
||||
] = value
|
||||
|
||||
|
||||
# A test Domain
|
||||
|
|
@ -40,14 +36,15 @@ def get_basic_domain():
|
|||
|
||||
# A test WorkflowType
|
||||
def _generic_workflow_type_attributes():
|
||||
return [
|
||||
"test-workflow", "v1.0"
|
||||
], {
|
||||
"task_list": "queue",
|
||||
"default_child_policy": "ABANDON",
|
||||
"default_execution_start_to_close_timeout": "7200",
|
||||
"default_task_start_to_close_timeout": "300",
|
||||
}
|
||||
return (
|
||||
["test-workflow", "v1.0"],
|
||||
{
|
||||
"task_list": "queue",
|
||||
"default_child_policy": "ABANDON",
|
||||
"default_execution_start_to_close_timeout": "7200",
|
||||
"default_task_start_to_close_timeout": "300",
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
def get_basic_workflow_type():
|
||||
|
|
@ -81,14 +78,17 @@ def setup_workflow():
|
|||
conn.register_domain("test-domain", "60", description="A test domain")
|
||||
conn = mock_basic_workflow_type("test-domain", conn)
|
||||
conn.register_activity_type(
|
||||
"test-domain", "test-activity", "v1.1",
|
||||
"test-domain",
|
||||
"test-activity",
|
||||
"v1.1",
|
||||
default_task_heartbeat_timeout="600",
|
||||
default_task_schedule_to_close_timeout="600",
|
||||
default_task_schedule_to_start_timeout="600",
|
||||
default_task_start_to_close_timeout="600",
|
||||
)
|
||||
wfe = conn.start_workflow_execution(
|
||||
"test-domain", "uid-abcd1234", "test-workflow", "v1.0")
|
||||
"test-domain", "uid-abcd1234", "test-workflow", "v1.0"
|
||||
)
|
||||
conn.run_id = wfe["runId"]
|
||||
return conn
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue