コード例 #1
0
def test_one_pass():
    plugin = ConsoleOutputPlugin()
    dispatcher = EventDispatcher()
    plugin.register(dispatcher)

    graph = bonobo.Graph()
    context = MagicMock(spec=GraphExecutionContext(graph))

    dispatcher.dispatch(events.START, events.ExecutionEvent(context))
    dispatcher.dispatch(events.TICK, events.ExecutionEvent(context))
    dispatcher.dispatch(events.STOPPED, events.ExecutionEvent(context))

    plugin.unregister(dispatcher)
コード例 #2
0
ファイル: test_events.py プロジェクト: zkan/bonobo
def test_event_object():
    # Same logic as above.
    c = Mock()
    e = events.ExecutionEvent(c)
    assert e.context is c
コード例 #3
0
 def dispatch(self, name):
     self.dispatcher.dispatch(name, events.ExecutionEvent(self))