scrapi.events.dispatch

Here are the examples of the python api scrapi.events.dispatch taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

4 Examples 7

Example 1

Project: scrapi Source File: test_logging.py
Function: test_dispatch
def test_dispatch(mock_event):
    events.dispatch('event', 'passed')
    mock_event.assert_called_once_with(
        'event', {'event': 'event', 'status': 'passed'})

Example 2

Project: scrapi Source File: test_logging.py
Function: test_dispatch_index
def test_dispatch_index(mock_event):
    events.dispatch('event', 'passed', _index='foo')
    mock_event.assert_called_once_with(
        'event.foo', {'event': 'event', 'status': 'passed'})

Example 3

Project: scrapi Source File: test_logging.py
def test_dispatch_kwargs(mock_event):
    events.dispatch('event', 'passed', ash='ketchem')
    mock_event.assert_called_once_with(
        'event', {'event': 'event', 'status': 'passed', 'ash': 'ketchem'})

Example 4

Project: scrapi Source File: test_logging.py
def test_dispatch_index_kwargs(mock_event):
    events.dispatch('event', 'passed', _index='pallet', ash='ketchem')
    mock_event.assert_called_once_with(
        'event.pallet', {'event': 'event', 'status': 'passed', 'ash': 'ketchem'})