Skip to content

Add test coverage#137

Merged
KJonline merged 35 commits into
devfrom
Add-test-coverage
May 17, 2026
Merged

Add test coverage#137
KJonline merged 35 commits into
devfrom
Add-test-coverage

Conversation

@KJonline

Copy link
Copy Markdown
Contributor

No description provided.

KJonline and others added 30 commits May 10, 2026 15:22
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
Comment thread tests/unit/test_heating_extended.py Fixed
Comment thread tests/unit/test_heating_extended.py Fixed
Comment thread tests/unit/test_heating_extended.py Fixed
_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
KJonline added 5 commits May 17, 2026 18:22
- 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
…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
@KJonline KJonline merged commit 0d61a89 into dev May 17, 2026
7 of 8 checks passed
@KJonline KJonline deleted the Add-test-coverage branch May 17, 2026 17:55
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.

1 participant