Orchestrata Ultimate › Tests › Reference › kernel › test_event_bus

Tests reference — tests/kernel/test_event_bus.py

Module of tests/kernel, split out because the directory page would be too large.

Prose pending.

tests/kernel/test_event_bus.py

source · 22 tests · 349 lines

Tests for kernel.event_bus — in-process EventBus paths (no Redis required).

Covers: kernel.event_bus, core.interfaces/ (package)

Kind Name Line Description
function test_subscribe_returns_subscription 83 subscribe returns an EventSubscription with expected fields.
function test_unsubscribe_existing 96 unsubscribe returns True for existing subscription.
function test_unsubscribe_missing 107 unsubscribe returns False for missing subscription.
function test_emit_calls_matching_handler 118 emit delivers event to matching in-process handler.
function test_emit_no_matching_handler 132 emit with no matching handlers completes silently.
function test_emit_handler_exception_logged 137 Handler exceptions are logged, not propagated.
function test_emit_increments_event_count 150 Successful handler delivery increments event_count.
function test_emit_handler_timeout 164 Slow handlers trigger timeout warning.
function test_subscriber_count_all 183 subscriber_count with no pattern counts all active subscribers.
function test_subscriber_count_with_pattern 188 subscriber_count filters by pattern.
function test_subscriber_count_expired 200 Expired subscriptions are not counted.
function test_subscriber_count_pattern_expired 210 Expired subscriptions are excluded from pattern counts.
function test_find_matching_handlers_filter_fn 225 filter_fn excludes non-matching events.
function test_find_matching_handlers_filter_fn_passes 236 filter_fn includes matching events.
function test_serialize_event 252 _serialize_event returns valid JSON string.
function test_deserialize_event 260 _deserialize_event round-trips correctly.
function test_deserialize_stream_entry_complete 269 _deserialize_stream_entry with complete data.
function test_deserialize_stream_entry_bad_payload 286 _deserialize_stream_entry handles malformed payload JSON.
function test_deserialize_stream_entry_bad_timestamp 301 _deserialize_stream_entry handles malformed timestamp.
function test_deserialize_stream_entry_missing_timestamp 316 _deserialize_stream_entry handles missing timestamp.
function test_close_no_redis 335 close is a no-op when Redis was never initialized.
function test_replay_redis_error 346 replay logs error and re-raises when Redis is unavailable.