Add BaseModel to all models.
This commit is contained in:
parent
caea5f441d
commit
6d422d1f37
34 changed files with 122 additions and 116 deletions
|
|
@ -2,13 +2,14 @@ from __future__ import unicode_literals
|
|||
from datetime import datetime
|
||||
import uuid
|
||||
|
||||
from moto.core import BaseModel
|
||||
from moto.core.utils import unix_time
|
||||
from ..exceptions import SWFWorkflowExecutionClosedError
|
||||
|
||||
from .timeout import Timeout
|
||||
|
||||
|
||||
class ActivityTask(object):
|
||||
class ActivityTask(BaseModel):
|
||||
|
||||
def __init__(self, activity_id, activity_type, scheduled_event_id,
|
||||
workflow_execution, timeouts, input=None):
|
||||
|
|
|
|||
|
|
@ -2,13 +2,14 @@ from __future__ import unicode_literals
|
|||
from datetime import datetime
|
||||
import uuid
|
||||
|
||||
from moto.core import BaseModel
|
||||
from moto.core.utils import unix_time
|
||||
from ..exceptions import SWFWorkflowExecutionClosedError
|
||||
|
||||
from .timeout import Timeout
|
||||
|
||||
|
||||
class DecisionTask(object):
|
||||
class DecisionTask(BaseModel):
|
||||
|
||||
def __init__(self, workflow_execution, scheduled_event_id):
|
||||
self.workflow_execution = workflow_execution
|
||||
|
|
|
|||
|
|
@ -1,13 +1,14 @@
|
|||
from __future__ import unicode_literals
|
||||
from collections import defaultdict
|
||||
|
||||
from moto.core import BaseModel
|
||||
from ..exceptions import (
|
||||
SWFUnknownResourceFault,
|
||||
SWFWorkflowExecutionAlreadyStartedFault,
|
||||
)
|
||||
|
||||
|
||||
class Domain(object):
|
||||
class Domain(BaseModel):
|
||||
|
||||
def __init__(self, name, retention, description=None):
|
||||
self.name = name
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from moto.core import BaseModel
|
||||
from moto.core.utils import camelcase_to_underscores
|
||||
|
||||
|
||||
class GenericType(object):
|
||||
class GenericType(BaseModel):
|
||||
|
||||
def __init__(self, name, version, **kwargs):
|
||||
self.name = name
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from moto.core import BaseModel
|
||||
from moto.core.utils import underscores_to_camelcase, unix_time
|
||||
|
||||
from ..utils import decapitalize
|
||||
|
|
@ -27,7 +28,7 @@ SUPPORTED_HISTORY_EVENT_TYPES = (
|
|||
)
|
||||
|
||||
|
||||
class HistoryEvent(object):
|
||||
class HistoryEvent(BaseModel):
|
||||
|
||||
def __init__(self, event_id, event_type, event_timestamp=None, **kwargs):
|
||||
if event_type not in SUPPORTED_HISTORY_EVENT_TYPES:
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
from moto.core import BaseModel
|
||||
from moto.core.utils import unix_time
|
||||
|
||||
|
||||
class Timeout(object):
|
||||
class Timeout(BaseModel):
|
||||
|
||||
def __init__(self, obj, timestamp, kind):
|
||||
self.obj = obj
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
from __future__ import unicode_literals
|
||||
import uuid
|
||||
|
||||
from moto.core import BaseModel
|
||||
from moto.core.utils import camelcase_to_underscores, unix_time
|
||||
|
||||
from ..constants import (
|
||||
|
|
@ -20,7 +21,7 @@ from .timeout import Timeout
|
|||
|
||||
|
||||
# TODO: extract decision related logic into a Decision class
|
||||
class WorkflowExecution(object):
|
||||
class WorkflowExecution(BaseModel):
|
||||
|
||||
# NB: the list is ordered exactly as in SWF validation exceptions so we can
|
||||
# mimic error messages closely ; don't reorder it without checking SWF.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue