Skip to content

Commit 530b212

Browse files
julienldclaude
andcommitted
refactor(tests): Address Gemini review comments
- Remove unused asyncio import from test_label_operations.py - Combine redundant rate limit checks in HACS test - Fix inconsistent error_str usage in HACS unavailability detection 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 3b18821 commit 530b212

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

tests/src/e2e/workflows/hacs/test_hacs.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,12 @@ def is_hacs_unavailable(data: dict) -> tuple[bool, str]:
5555
unavailable_indicators = [
5656
(error_code == "HACS_NOT_AVAILABLE", "HACS not available"),
5757
(error_code == "HACS_DISABLED", f"HACS disabled: {data.get('disabled_reason', 'unknown')}"),
58-
(error_code == "INTERNAL_ERROR" and "rate" in error_str, "GitHub rate limit"),
58+
((error_code == "INTERNAL_ERROR" and "rate" in error_str) or ("rate" in error_str and "limit" in error_str), "GitHub rate limit"),
5959
(error_code == "INTERNAL_ERROR" and "github" in error_str, "GitHub access issue"),
6060
("not found" in error_str, "Command not found"),
6161
("unknown command" in error_str, "Unknown command"),
6262
("disabled" in error_str, "HACS disabled"),
63-
("rate" in error_str and "limit" in error_str, "GitHub rate limit"),
64-
("401" in str(error), "GitHub authentication failed"),
63+
("401" in error_str, "GitHub authentication failed"),
6564
]
6665

6766
for condition, reason in unavailable_indicators:

tests/src/e2e/workflows/labels/test_label_operations.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
Also includes regression test for Issue #396 (entity registry corruption).
1111
"""
1212

13-
import asyncio
1413
import logging
1514

1615
import pytest

0 commit comments

Comments
 (0)