示例#1
0
    def test_workflow_type_register_defaults(self):
        wf_type = WorkflowType(name='name', domain='test', version='1')
        wf_type.register()

        wf_type._swf.register_workflow_type.assert_called_with('test', 'name', '1',
            default_execution_start_to_close_timeout=ANY,    
            default_task_start_to_close_timeout=ANY,
            default_child_policy=ANY
        )
示例#2
0
    def test_workflow_type_start_execution(self):
        wf_type = WorkflowType(name='name', domain='test', version='1')
        run_id = '122aJcg6ic7MRAkjDRzLBsqU/R49qt5D0LPHycT/6ArN4='
        wf_type._swf.start_workflow_execution.return_value = {'runId': run_id}
        
        execution = wf_type.start(task_list='hello_world')

        self.assertIsInstance(execution, WorkflowExecution)
        self.assertEquals(wf_type.name, execution.name)
        self.assertEquals(wf_type.version, execution.version)
        self.assertEquals(run_id, execution.runId)
示例#3
0
    def test_workflow_type_start_execution(self):
        wf_type = WorkflowType(name="name", domain="test", version="1")
        run_id = "122aJcg6ic7MRAkjDRzLBsqU/R49qt5D0LPHycT/6ArN4="
        wf_type._swf.start_workflow_execution.return_value = {"runId": run_id}

        execution = wf_type.start(task_list="hello_world")

        self.assertIsInstance(execution, WorkflowExecution)
        self.assertEquals(wf_type.name, execution.name)
        self.assertEquals(wf_type.version, execution.version)
        self.assertEquals(run_id, execution.runId)
示例#4
0
    def test_workflow_type_register_defaults(self):
        wf_type = WorkflowType(name="name", domain="test", version="1")
        wf_type.register()

        wf_type._swf.register_workflow_type.assert_called_with(
            "test",
            "name",
            "1",
            default_execution_start_to_close_timeout=ANY,
            default_task_start_to_close_timeout=ANY,
            default_child_policy=ANY,
        )