本文整理汇总了Python中simpleflow.swf.executor.Executor.get_event_details方法的典型用法代码示例。如果您正苦于以下问题:Python Executor.get_event_details方法的具体用法?Python Executor.get_event_details怎么用?Python Executor.get_event_details使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类simpleflow.swf.executor.Executor
的用法示例。
在下文中一共展示了Executor.get_event_details方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_get_event_details
# 需要导入模块: from simpleflow.swf.executor import Executor [as 别名]
# 或者: from simpleflow.swf.executor.Executor import get_event_details [as 别名]
def test_get_event_details(self):
history = builder.History(ExampleWorkflow, input={})
signal_input = {'x': 42, 'foo': 'bar', '__propagate': False}
marker_details = {'baz': 'bae'}
history.add_signal('a_signal', signal_input)
history.add_marker('a_marker', marker_details)
history.add_timer_started('a_timer', 1, decision_id=2)
history.add_timer_fired('a_timer')
executor = Executor(DOMAIN, ExampleWorkflow)
executor.replay(Response(history=history, execution=None))
details = executor.get_event_details('signal', 'a_signal')
del details['timestamp']
expect(details).to.equal({
'type': 'signal',
'state': 'signaled',
'name': 'a_signal',
'input': signal_input,
'event_id': 4,
'external_initiated_event_id': 0,
'external_run_id': None,
'external_workflow_id': None,
})
details = executor.get_event_details('signal', 'another_signal')
expect(details).to.be.none
details = executor.get_event_details('marker', 'a_marker')
del details['timestamp']
expect(details).to.equal({
'type': 'marker',
'state': 'recorded',
'name': 'a_marker',
'details': marker_details,
'event_id': 5,
})
details = executor.get_event_details('marker', 'another_marker')
expect(details).to.be.none
details = executor.get_event_details('timer', 'a_timer')
del details['started_event_timestamp']
del details['fired_event_timestamp']
expect(details).to.equal({
'type': 'timer',
'state': 'fired',
'id': 'a_timer',
'decision_task_completed_event_id': 2,
'start_to_fire_timeout': 1,
'started_event_id': 6,
'fired_event_id': 7,
'control': None,
})
details = executor.get_event_details('timer', 'another_timer')
expect(details).to.be.none