[claude] test: improve event bus unit test coverage to 99% (#1191) #1201
Reference in New Issue
Block a user
Delete Branch "claude/issue-1191"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #1191
The
infrastructure/events/bus.pymodule had 0 tests when the issue was filed. A prior PR added the base test suite; this PR extends it to cover the remaining uncovered paths.Changes
TestSingletonHelpersclass with 5 tests:get_event_bus()singleton identityinit_event_bus_persistence()sets path on singletoninit_event_bus_persistence()is idempotent (second call ignored)init_event_bus_persistence()usesdata/events.dbas default path__getattr__raisesAttributeErrorfor unknown attributes_persist_event()swallowssqlite3.OperationalError(lines 143-144)replay()returns[]on query failure (lines 200-202)Coverage
infrastructure/events/bus.py: 92.7% → 99.3% (38 tests, all passing)The single remaining uncovered line (101) is a defensive early-return guard inside
_init_persistence_dbthat is structurally unreachable through the public API.