Issue #164: rename safety YAML generator tests and add parametrized coverage#175
Merged
Merged
Conversation
0b696bf to
5138864
Compare
Rename tests/unit/test_yaml_generator.py -> test_safety_yaml_generator.py via git mv (preserves history) to mirror pumpahead/safety_yaml_generator.py. Augment with: - living_room_fixture + multi_room_fixture (reusable pytest fixtures including the no-split 'Lazienka Dolna' bathroom heating-only case) - TestSafetyYAMLConfigExtra: empty/whitespace entity_pumpahead_last_update validators (closes line 161-163 coverage gap, bringing coverage to 100%) - TestIdempotency: explicit string-equality checks for full, multi-room, and per-room YAML generation - TestParametrizedThresholds: 26 parametrized test invocations covering S1/S3/S4 numeric thresholds, S5 template thresholds, S2 margins, and split-presence drives HVAC action logic - TestBathroomHeatingOnly: documents no-split room edge case (S2/S3/S4) - TestHumiditySensorAbsence: parametrized negative + positive S2 template - TestMultiRoomFixture: exercises multi_room_fixture end-to-end Coverage on pumpahead/safety_yaml_generator.py: 100%. ruff check + format: clean.
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.
Summary
tests/unit/test_yaml_generator.py->tests/unit/test_safety_yaml_generator.pyviagit mv(history preserved) to mirrorpumpahead/safety_yaml_generator.py.living_room_fixture,multi_room_fixture), empty/whitespaceentity_pumpahead_last_updatevalidator tests (closes previously uncovered branch), explicit string-equality idempotency tests, 4 parametrized threshold grids (26 invocations total), bathroom heating-only (no-split) edge case, and humidity-sensor absence tests.Test plan
pytest tests/unit/test_safety_yaml_generator.py -q- 122 passed, zero warnings underfilterwarnings = ["error"]pytest tests/unit -x- full unit suite greenruff checkandruff format --checkpassgit log --followshows pre-rename history (rename preserved)Closes #164