test(eventbus): pin WAMP prefix subscribe to details_arg='details' - #119
Open
RameshHertzai wants to merge 1 commit into
Open
RameshHertzai wants to merge 1 commit into
RameshHertzai wants to merge 1 commit into
Conversation
Follow-up to the #118 review (lawlietlight): the receive path had no regression guard, and the "details=None -> silent drop" class reappears easily. This asserts connect_wamp's on_join subscribes with SubscribeOptions(match='prefix', details_arg='details') by capturing the registered on_join handler (Component + background thread mocked) and driving it with a mock session. Fails if the option is dropped or the plain-dict form returns (autobahn then never injects EventDetails and every inbound event is dropped).
RameshHertzai
force-pushed
the
test/pin-wamp-details-arg
branch
from
September 10, 2026 05:35
a3f61bd to
4b65518
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to the #118 review — the receive-path fix had no regression guard, and the "details=None → silent drop" class reintroduces easily.
What this adds
One unit test in
tests/unit/test_eventbus_wamp_tts.pythat pinsEventBus.connect_wamp()'s subscription options. It captures theon_joinhandler registered via@component.on_join(withComponentand the background thread mocked), drives it with a mock session, and asserts:session.subscribe(...)is called with aSubscribeOptionsinstanceoptions.details_arg == 'details'options.match == 'prefix'If the option is dropped or the plain-dict form (
{'match': 'prefix'}) returns, autobahn never injectsEventDetails,_on_wamp_event'sdetailsisNone, and every inbound event hitsif not wamp_topic: return— the test fails.Verification
35 passed(no regression)From the #118 review, not included here (with reasons)
pytest not in sys.modulesguard on the SelectorEventLoop policy block — the review flagged it as minor/harmless; adding it would skip setting the selector policy under pytest, which is a behavioral change with no upside for this test, so I left it out to keep the diff test-only.hevolveaiHiveMind.connect_wampsibling fix — that module is closed-source and loaded at runtime; its source isn't in this repo, so it can't be fixed here. Worth a separate task at that process's entry.Scope: one test file, additive only.