def _call_handlers(event_spec, data): event = Mock(spec=Event) parts = event_spec.split(".") category = parts[0] verb = ".".join(parts[1:]) type(event).parts = PropertyMock(return_value=parts) type(event).category = PropertyMock(return_value=category) type(event).verb = PropertyMock(return_value=verb) call_handlers(event=event) return event
def _call_handlers(event_spec, data): event = Mock(spec=Event) event_parts = event_spec.split(".") event_type = event_parts[0] event_subtype = ".".join(event_parts[1:]) type(event).parts = PropertyMock(return_value=event_parts) type(event).event_type = PropertyMock(return_value=event_type) type(event).event_subtype = PropertyMock(return_value=event_subtype) return call_handlers(event, data, event_type, event_subtype)