Event Fallback¶
-
Back to Testing Overview
Return to the Testing overview page with all topics.
Both classes are on invocations. The primary handler is entered, then the fallback.
def domain_events_mapper(mapper: cqrs.EventMap) -> None:
mapper.bind(
OrderCreated,
cqrs.EventHandlerFallback(AuditHandler, AuditFallback),
)
await harness.mediator.send(CreateOrder(sku="book"))
harness.invocations.assert_entered(AuditHandler)
harness.invocations.assert_entered(AuditFallback)
Library example: examples/testing/fallback.py.