Repository navigation
Streamline and isolate the ccu-cli test suite (sussdorff/ccu-cli#7) - #8
Conversation
load_dotenv() searched upward from the package and wrote os.environ directly, so a .env outside the worktree changed configuration tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: sussdorff/ccu-cli/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (13)
💤 Files with no reviewable changes (1)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe pull request adds test isolation and pytest/Ruff configuration, updates client type annotations and CLI lint handling, changes numeric timestamp conversion, and revises tests for environment isolation and protocol behavior. ChangesTest setup and isolation
Client typing and CLI lint annotations
Timestamp and protocol test coverage
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Other Merge Risk: ⚪ Minimal · up to The changes are mergeable after normal checks; no actionable merge-blocking risk remains identified. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Streamline and isolate the ccu-cli test suite (#7)
Summary
Brings the suite in line with the test-suite standard (rollout cognovis/library-core#79):
.envdiscovery.-n auto).mainalready failed Ruff with 92 findings; the fixes are behavior-preserving.Kept invariants
--yesguards: confirm, decline and bypass, withassert_not_called()on the destructive call when the user declines.https=True.00:00,24:00, single- and two-digit hours, invalid hour25:00, invalid minute12:60, missing colon.ReGaError"not found" path.except,sys.exit(1)andclick.confirmcalls incli.pymatchmainexactly.Isolation
load_config()callsload_dotenv(), which searches upward from the package directory and writes toos.environ. A.envbeyond the worktree (on this host,~/.env) could therefore override test values. The fixture now neutralizesload_dotenvand clears theCCU_*variables.Deleted categories (168 -> 162)
test_rega.py::test_uses_http_by_default,test_xmlrpc.py::test_uses_http_by_default(stronger siblings assert HTTP underhttps=True)test_rega.py::test_returns_response_text,test_handles_multiline_responsetest_schedule.py:test_parses_morning,test_parses_afternoon,test_formats_morningOne test is added,
test_environment.py, which asserts that the isolation stays in place.Ruff repairs
except Exceptionhandlers now carry a line-local# noqa: BLE001. There is no rule narrowing, and each suppression is still needed (RUF100is clean).passstatements after docstrings are removed.if not yes: if not confirm(...)blocks becomeand; short-circuit evaluation keeps the guard.fromtimestamp(ts)becomesfromtimestamp(ts, tz=UTC).astimezone(). The output is identical: 20,000 random timestamps and both DST transitions matched.Evidence
main-n0-n auto)-n autois slower than serial here: startup time dominates a sub-second suite. The standard requires parallel by default anyway.uv run ruff check .: all checks passed.uv lock --check: ok. The lock also refreshes a stale self-entry (0.3.1 to 0.4.0).rg -n "uv run" tests: no matches.Merge Danger
🤖 Generated with Claude Code
Harness: claude
Session: sc-046d7880ae0712278a08
Beads: #7
Delivered-by: ccore pull-request delivery
Summary by CodeRabbit