Skip to content

test: increase unit test coverage (cloud, cover, remote, datetime, config_flow, entity)#5304

Merged
make-all merged 3 commits into
make-all:mainfrom
lweikit:test/increase-unit-test-coverage
Jun 14, 2026
Merged

test: increase unit test coverage (cloud, cover, remote, datetime, config_flow, entity)#5304
make-all merged 3 commits into
make-all:mainfrom
lweikit:test/increase-unit-test-coverage

Conversation

@lweikit

@lweikit lweikit commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Adds unit tests for existing Python code — no production changes. This is the "complete the remaining unit tests" item from the README's Contributing section.

Coverage across the six modules goes from 43% → 94% (502 lines newly covered):

Module Before After
cloud.py 25% 99%
cover.py 34% 98%
remote.py 31% 93%
datetime.py 31% 88%
config_flow.py 53% 91%
entity.py 85% 94%

test_config_flow_extended.py complements the existing test_config_flow.py (cloud/scan/search/connection paths). All 379 suite tests pass; ruff check, ruff format --check and the existing tests are clean.

🤖 Generated with Claude Code

…ig_flow, entity

Adds unit tests for Python code (no production changes), per the
'complete the remaining unit tests' item in the README.

Coverage across these modules rises from 43% to 94%:
- cloud.py        25% -> 99%
- cover.py        34% -> 98%
- remote.py       31% -> 93%
- datetime.py     31% -> 88%
- config_flow.py  53% -> 91%
- entity.py       85% -> 94%

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Comment thread tests/test_config_flow_extended.py Outdated

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests should be merged into test_config_flow.py rather than adding a new file.

Comment thread tests/test_cover_unit.py Outdated

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These files should be merged to the existing entity test files.

@github-project-automation github-project-automation Bot moved this from 👀 In review to 🏗 Stalled in Tuya Local Jun 13, 2026
Fold the new cover/datetime/remote/config_flow tests into their existing
per-module test files and remove the parallel *_unit/_extended files, per
maintainer review. test_entity.py and test_cloud.py are kept as new files
since entity.py and cloud.py had no existing test file to merge into.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@lweikit

lweikit commented Jun 14, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review. I've merged the new tests into the existing per-module files and removed the parallel files:

  • test_cover_unit.pytest_cover.py
  • test_datetime_unit.pytest_datetime.py
  • test_remote_unit.pytest_remote.py
  • test_config_flow_extended.pytest_config_flow.py

Two remain as new files — test_entity.py (base TuyaLocalEntity) and test_cloud.py (the Cloud class) — because those modules had no existing test file to merge into. Happy to relocate them if you'd prefer a different home (e.g. base-entity tests in test_device.py).

Full suite passes (379 tests) and ruff check / ruff check --select I / ruff format --check / yamllint are all clean.

@make-all
make-all merged commit be80510 into make-all:main Jun 14, 2026
4 checks passed
@github-project-automation github-project-automation Bot moved this from 🏗 Stalled to ✅ Done in Tuya Local Jun 14, 2026
make-all added a commit that referenced this pull request Jun 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants