Skip to content

test(eventbus): pin WAMP prefix subscribe to details_arg='details' - #119

Open
RameshHertzai wants to merge 1 commit into
mainfrom
test/pin-wamp-details-arg
Open

RameshHertzai wants to merge 1 commit into
mainfrom
test/pin-wamp-details-arg

Conversation

@RameshHertzai

Copy link
Copy Markdown
Contributor

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.py that pins EventBus.connect_wamp()'s subscription options. It captures the on_join handler registered via @component.on_join (with Component and the background thread mocked), drives it with a mock session, and asserts:

  • session.subscribe(...) is called with a SubscribeOptions instance
  • options.details_arg == 'details'
  • options.match == 'prefix'

If the option is dropped or the plain-dict form ({'match': 'prefix'}) returns, autobahn never injects EventDetails, _on_wamp_event's details is None, and every inbound event hits if not wamp_topic: return — the test fails.

Verification

  • New test: PASS
  • Full file: 35 passed (no regression)

From the #118 review, not included here (with reasons)

  • pytest not in sys.modules guard 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.
  • hevolveai HiveMind.connect_wamp sibling 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.

@RameshHertzai
RameshHertzai requested a review from a team September 3, 2026 08:39
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
RameshHertzai force-pushed the test/pin-wamp-details-arg branch from a3f61bd to 4b65518 Compare September 10, 2026 05:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant