test: a keypad press reaches the bus, not just the funnel - #1517
Merged
Conversation
The three notification tests stop at async_fire_code_slot_event, so nothing proved a zwave_js keypad press produces the credential_used event consumers actually subscribe to -- and the funnel stays silent for a slot no entry manages, which is what those tests configure. Adds one end-to-end assertion on the provider whose decoding is most intricate; a mis-decoded slot now surfaces as the wrong person's name. Also drops the topic parameter _process_notification no longer reads, dead since the lock_state_changed removal took its only use. Entire-Checkpoint: 48f01fec5966
5 tasks
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.
Breaking change
None.
Proposed change
Two loose ends from a provider-layer review of #1514, both artifacts of the
lock_state_changedremoval.A keypad press is now tested to the bus, not just to the funnel. The three zwave_js notification tests were converted in this PR from capturing a real event to
zwave_js_lock.async_fire_code_slot_event = MagicMock(). That proves the provider's notification decoding calls the funnel, but not that anything reaches the bus — and the funnel is deliberately silent for a slot no entry manages, which is exactly what those tests configure (CONF_SLOTS: {}). So after that change, nothing anywhere proved a zwave_js keypad press produces acredential_usedevent.This adds one end-to-end test on the existing fully-set-up
lcm_config_entryfixture. It asserts the payload names the person, so a mis-decoded slot surfaces as the wrong user's name rather than a number — mutation-verified by offsetting the decodeduserId, which fails withassert 'slot2' == 'slot1'.I did not convert the other three back: they cover the decoding branches cheaply and correctly at that level. The gap was that nothing sat above them.
_process_notification'stopicparameter is dead. Its only use wassource_data={"topic": topic, ...}, deleted with the event. Sibling of theOPERATION_SOURCE_NAMESconstant already removed; an unused-argument diff across all nine providers betweenmainandv6says this is the last one.Type of change
Additional information
prekclean.main, not a v6 regression, and is filed separately rather than bundled here.