Skip to content

Conversation

@bouwew
Copy link
Contributor

@bouwew bouwew commented Nov 10, 2025

Summary by CodeRabbit

  • Tests
    • Updated test configuration and setup for improved sensor testing scenarios.

Note: This release contains no user-visible changes—the update is to internal test infrastructure.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 10, 2025

Walkthrough

The PR modifies a single test file to update the test_adam_sensor_snapshot test function by replacing the mock fixture from mock_smile_adam to mock_smile_adam_heat_cool and adding two parametrize decorators to adjust test environment and cooling configuration parameters.

Changes

Cohort / File(s) Summary
Test fixture and parameter updates
tests/components/plugwise/test_sensor.py
Updated test_adam_sensor_snapshot to use mock_smile_adam_heat_cool mock instead of mock_smile_adam, and added chosen_env and cooling_present parametrize decorators to configure test behavior

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • Review the mock fixture replacement to ensure mock_smile_adam_heat_cool provides the expected behavior
  • Verify the parametrize decorators (chosen_env=["m_adam_heating"], cooling_present=[False]) align with the test's intent

Poem

🐰 A snapshot test finds new fixtures so fine,
With heat-cool mocks and parameters aligned,
Adam wears new clothes, no cooling in sight,
The parametrized path shines with test light! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: updating a sensor snapshot test case to use a fixture with Emma data while following Core patterns.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch emma-in-snapshot

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fbcccd6 and 61ccdda.

📒 Files selected for processing (1)
  • tests/components/plugwise/test_sensor.py (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2024-09-27T09:48:30.890Z
Learnt from: bouwew
Repo: plugwise/plugwise-beta PR: 734
File: tests/components/plugwise/test_config_flow.py:58-58
Timestamp: 2024-09-27T09:48:30.890Z
Learning: In `tests/components/plugwise/test_config_flow.py`, the versions are mocked firmware versions for testing purposes and do not need to match the software version in `manifest.json`.

Applied to files:

  • tests/components/plugwise/test_sensor.py
📚 Learning: 2025-08-23T16:26:34.700Z
Learnt from: bouwew
Repo: plugwise/plugwise-beta PR: 906
File: tests/components/plugwise/test_binary_sensor.py:9-16
Timestamp: 2025-08-23T16:26:34.700Z
Learning: The Plugwise integration test files import utilities like `snapshot_platform`, `MockConfigEntry`, and `async_fire_time_changed` from `tests.common`, which is from the Home Assistant core repository at https://github.com/home-assistant/core/blob/master/tests/common.py, not from local test files.

Applied to files:

  • tests/components/plugwise/test_sensor.py
🧬 Code graph analysis (1)
tests/components/plugwise/test_sensor.py (1)
tests/components/plugwise/conftest.py (1)
  • mock_smile_adam_heat_cool (185-208)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Prepare and validate pre-commit
🔇 Additional comments (2)
tests/components/plugwise/test_sensor.py (2)

22-22: Fixture change is appropriate—no action needed.

The change from mock_smile_adam to mock_smile_adam_heat_cool is correct and localized to this test file. The mock_smile_adam fixture remains actively used by other test files (test_switch.py, test_select.py, test_number.py, test_climate.py, and others) and is not being deprecated. This change simply uses the more specific fixture that supports the parametrization added to this particular test file.


16-17: No changes needed. Test data verified and fixtures are properly configured.

The parametrization is correct: chosen_env="m_adam_heating" is an existing fixture with corresponding test data at tests/components/plugwise/fixtures/m_adam_heating/. Snapshot files already reference this configuration with Emma sensor entries (e.g., sensor.emma_battery, sensor.emma_temperature), confirming the fixture contains the Emma data mentioned in the PR. The pattern matches other parametrized tests in the file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud
Copy link

@bouwew bouwew marked this pull request as ready for review November 11, 2025 07:24
@bouwew bouwew requested a review from a team as a code owner November 11, 2025 07:24
@bouwew bouwew merged commit 0c70043 into main Nov 11, 2025
13 checks passed
@bouwew bouwew deleted the emma-in-snapshot branch November 11, 2025 07:24
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.

2 participants