Fix BleBox action tests to assert library calls instead of faking state - #175460
Merged
joostlek merged 1 commit intoJul 3, 2026
Merged
Conversation
Contributor
|
Hey there @bbx-a, @swistakm, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request updates BleBox integration action tests to stop faking device state changes via mock side effects and instead verify that the BleBox library methods are invoked with the expected arguments.
Changes:
- Replace state-based assertions in BleBox action tests with mock call assertions (e.g.,
assert_called_once_with()). - Simplify sensor “None value” tests by setting
native_valuedirectly rather than viaasync_updateside effects. - Refactor several climate/cover/light action tests to focus on verifying library calls from Home Assistant services.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
tests/components/blebox/test_switch.py |
Switch action tests now assert BleBox switch library calls instead of mutating is_on via side effects. |
tests/components/blebox/test_sensor.py |
Sensor “None value” behavior is tested by setting native_value directly. |
tests/components/blebox/test_light.py |
Light action tests now assert library calls; effect handling adds a negative assertion for API commands. |
tests/components/blebox/test_cover.py |
Cover action tests now assert library calls for open/close/stop/position/tilt operations. |
tests/components/blebox/test_climate.py |
Climate action tests now assert BleBox library calls for HVAC mode and temperature setting. |
bkobus-bbx
marked this pull request as ready for review
July 3, 2026 12:49
joostlek
approved these changes
Jul 3, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Proposed change
Action tests for BleBox entities (switch/cover/climate/light/sensor) faked state changes via side_effect instead of verifying the library was called correctly. This PR replaces those with
assert_called_once_with()on the library mock.Type of change
Additional information
Checklist
ruff format homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all.To help with the load of incoming pull requests: