Skip to content

Conversation

@allenporter
Copy link
Contributor

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.

Copilot AI review requested due to automatic review settings December 23, 2025 21:42
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
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