fix(tests): add iCloud mocks to all test files and address code review feedback

- Add _should_upload_to_icloud mock to test_coverage_uploads_notification.py
  (_all_should_upload_false helper + 3 inline patch blocks)
- Add cfg.icloud_username/password = None to all onboarding test mocks
- Add iCloud creds to fully-configured onboarding test
- Fix noqa comment accuracy (unofficial third-party, not first-party)
- Replace generic Exception with RuntimeError in upload error handler

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-03-11 23:59:19 +00:00
parent 528f0a624d
commit 50af0ea679
3 changed files with 32 additions and 2 deletions
+2 -2
View File
@@ -59,7 +59,7 @@ def _get_icloud_api(
ImportError: If ``pyicloud`` is not installed.
ValueError: If authentication fails or 2FA is required interactively.
"""
from pyicloud import PyiCloudService # noqa: S404 trusted first-party usage
from pyicloud import PyiCloudService # noqa: S404 unofficial third-party iCloud client
kwargs: dict = {}
if cookie_directory:
@@ -174,4 +174,4 @@ def upload_to_icloud(self, file_path: str, file_id: int = None, folder_override:
error_msg = f"Error uploading {filename} to iCloud Drive: {e}"
logger.error(f"[{task_id}] {error_msg}")
log_task_progress(task_id, "upload_to_icloud", "failure", error_msg, file_id=file_id)
raise Exception(error_msg) from e
raise RuntimeError(error_msg) from e