Repository navigation
test(energy): assert parsed properties on negative and empty auto-update intervals - #107
Merged
GreenGrassBlueOcean merged 1 commit intoOct 11, 2026
Conversation
…ate intervals Follow-up to PR #102 review observation from @fedem95: - Exercise OWNEnergyEvent.__init__ parsing path with corrupted negative interval via monkeypatch - Assert update_interval, stream_duration, is_streaming_active, and human_readable_log - Add test_empty_interval_clamped_to_stopped to verify on-wire empty parameter fallback
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
GreenGrassBlueOcean
deleted the
test/who18-auto-update-interval-assertions
branch
October 11, 2026 17:39
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.
WHO 18 Auto-Update Telemetry Clamping Assertions
Follow-up to #102 addressing the review observation by @fedem95 on PR #102 (review 5482727424):
What changes?
Exercise
OWNEnergyEvent.__init__Clamping Path:test_negative_interval_clamped_to_stopped, interceptOWNEvent.__init__usingmonkeypatchso thatself._dimension_value = ["-5"]beforeOWNEnergyEvent's dimension-1200 parsing branch runs.update_interval == 0stream_duration == 0is_streaming_active is Falsehuman_readable_log == "Sensor 1 automatic updates stopped."Add
test_empty_interval_clamped_to_stopped:*#18*51*1200#1*##)._integer_value([""], 0)fallback behavior and asserts the same stopped state properties.Verification
pytest -p no:homeassistant).verify_library_standards.pyandruff checkpass with 0 errors.