chore: Add an end to end device manager test#705
Merged
allenporter merged 2 commits intoPython-roborock:mainfrom Dec 29, 2025
Merged
chore: Add an end to end device manager test#705allenporter merged 2 commits intoPython-roborock:mainfrom
allenporter merged 2 commits intoPython-roborock:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds an end-to-end test for the Device Manager that exercises the workflow where a device looks up device information from MQTT and then connects locally using the v1 protocol (without using cached data). The test uses mocked MQTT broker and local device connections to simulate real-world behavior.
- Adds comprehensive e2e test for Device Manager with MQTT and local connection flow
- Includes snapshot testing for request/response verification
- Adds v3 API endpoint mock to support newer API version
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tests/e2e/test_device_manager.py | New end-to-end test file with Device Manager test, helper fixtures, and ResponseBuilder utility class |
| tests/e2e/snapshots/test_device_manager.ambr | Snapshot file capturing expected MQTT and local protocol message exchanges |
| tests/fixtures/web_api_fixtures.py | Added mock for v3/user/homes endpoint to support v3 API calls |
| tests/e2e/init.py | Registered web_api_fixtures plugin for e2e tests |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Use the existing test to also exercise the cache by closing the device manager and reconnecting.
Lash-L
approved these changes
Dec 29, 2025
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.
Add an end to end test for the Device Manager. This exercises the case where there is no cache and the device looks up the device info from MQTT then connects locally over v1 protocol. We'll add additional scenarios in followup changes.