Add test coverage#137
Merged
Merged
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
48 tests covering epoch_time, convert_minutes_to_time, sanitize_payload, device_recovered, get_device_name, error_check, get_device_from_id, and get_device_data — including boundary cases and branching paths. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
22 tests covering online_offline, get_battery, get_mode, and state_attributes, including HIVETOHA mapping behaviour, battery % formatting, and mode/battery list gating. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…efresh_tokens Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove empty test_hub_smoke placeholder - Remove redundant @pytest.mark.asyncio decorators (asyncio_mode=auto handles it) - Add test_session_polling.py: 5 tests for update_data rate-limiting - Add test_session_discovery.py: 8 tests for start_session branches and create_devices error/group-product filtering Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add source directive to track apyhiveapi package - Enable skip_covered reporting option - Rename lcov output from coverage.lcov to lcov.info - Update .gitignore to reflect new lcov filename
- Add coverage target to run pytest with coverage and generate lcov report
…rage - Remove standalone .coveragerc file - Move coverage configuration into pyproject.toml [tool.coverage.*] sections - Add pyhive package data directive for data/*.json files - Normalize keywords casing in project metadata - Add 4 tests for Switch.get_switch edge cases: cache miss fallthrough, non-dict device_data replacement, non-activeplug type handling - Add test for Attributes.state_attributes when battery device returns
…datetime.now(UTC) - Move coverage output to coverage/ directory (html, lcov.info, .coverage) - Add pytest coverage flags to pyproject.toml addopts - Enable branch coverage and show_contexts in HTML reports - Omit deprecation shim files from coverage (action.py, boost.py, etc.) - Add exclude_also patterns for TYPE_CHECKING, abstractmethod, NotImplementedError - Update .gitignore to reflect new coverage/ directory structure - Replace
| _ON_MODE = "ON" | ||
| _OFF_MODE = "OFF" | ||
| _BOOST_MODE = "BOOST" | ||
| _BOOST_MINS = 30 |
|
|
||
| release_task = asyncio.create_task(_release_after_refresh()) | ||
| result = await s.hive_refresh_tokens(force_refresh=False) | ||
| await release_task |
|
|
||
| release_task = asyncio.create_task(_refresh_and_release()) | ||
| result = await p.update_data(_make_device()) | ||
| await release_task |
- Rename workflow from "CI" to "Lint" - Narrow workflow path trigger from `.github/workflows/**` to `.github/workflows/ci.yml` - Remove tests job (Python 3.10-3.13 matrix) - Add blank lines between pre-commit job steps for readability - Split apt-get install command across multiple lines
….10 compatibility
…used test constants - Replace datetime.UTC with datetime.timezone.utc in DeviceRegistrationMixin.register_device - Remove unused constants from test_heating_extended.py (_TARGET_TEMP, _MANUAL_MODE, _BOOST_MODE, _BOOST_MINS)
- Reduce project coverage target from 100% to 10% - Reduce patch coverage target from 100% to 10% - Keep threshold at 0% for both targets
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.
No description provided.