tests: Add mock tests for HTS221 auto-trigger after poweroff.#96
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds mock tests for the HTS221 driver's auto-trigger path (_ensure_data() / trigger_one_shot()), which was previously untested in mock mode. It also introduces a setup mechanism in the test executor to call driver methods before the main test action.
Changes:
- Added 3 new mock-only YAML test scenarios exercising the auto-trigger path after
poweroff()andtrigger_one_shot() - Added
setupstep support inexecutor.py'srun_action()to call preparatory methods before the main action
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/scenarios/hts221.yaml | Added 3 mock test cases for auto-trigger after poweroff/one-shot mode |
| tests/runner/executor.py | Added setup step processing before the main action in run_action() |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
🎉 This PR is included in version 0.0.2 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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
Closes #95.
_ensure_data()/trigger_one_shot()auto-trigger path:Auto-trigger temperature after poweroff— callspoweroff()thentemperature()Auto-trigger humidity after poweroff— callspoweroff()thenhumidity()Auto-trigger read after one-shot mode— callstrigger_one_shot()thenread()setupsupport inexecutor.pyrun_action()— allows calling methods on the driver instance before the main test actionTest plan
python3 -m pytest tests/ -k "hts221 and mock" -vMock test results
ruff checkpasses