From 21f9998706c6129a336f57b4d6d481b3e1faf5d9 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Mon, 16 Mar 2026 09:48:38 +0000 Subject: [PATCH] Fix tests affected by os.path mock updates in onedrive coverage Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com> --- tests/test_api_onedrive_coverage.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/test_api_onedrive_coverage.py b/tests/test_api_onedrive_coverage.py index fd3e63dd..6e0ed1bc 100644 --- a/tests/test_api_onedrive_coverage.py +++ b/tests/test_api_onedrive_coverage.py @@ -75,8 +75,8 @@ class TestTestTokenRotation: patch.object(settings, "onedrive_refresh_token", "old_token"), patch.object(settings, "onedrive_client_id", "cid"), patch.object(settings, "onedrive_client_secret", "sec"), - patch("app.api.onedrive.os.path.join", return_value=str(env_file)), - patch("app.api.onedrive.os.path.exists", return_value=True), + patch("app.utils.env_utils.os.path.join", return_value=str(env_file)), + patch("app.utils.env_utils.os.path.exists", return_value=True), patch("app.database.SessionLocal") as mock_session_local, patch("app.api.onedrive.save_setting_to_db"), patch("app.api.onedrive.notify_settings_updated"), @@ -117,7 +117,7 @@ class TestTestTokenRotation: patch.object(settings, "onedrive_refresh_token", "old_token"), patch.object(settings, "onedrive_client_id", "cid"), patch.object(settings, "onedrive_client_secret", "sec"), - patch("app.api.onedrive.os.path.exists", return_value=False), + patch("app.utils.env_utils.os.path.exists", return_value=False), patch("app.database.SessionLocal") as mock_session_local, patch("app.api.onedrive.save_setting_to_db"), patch("app.api.onedrive.notify_settings_updated"), @@ -157,7 +157,7 @@ class TestTestTokenRotation: patch.object(settings, "onedrive_refresh_token", "old_token"), patch.object(settings, "onedrive_client_id", "cid"), patch.object(settings, "onedrive_client_secret", "sec"), - patch("app.api.onedrive.os.path.exists", return_value=True), + patch("app.utils.env_utils.os.path.exists", return_value=True), patch("builtins.open", side_effect=PermissionError("Permission denied")), patch("app.database.SessionLocal") as mock_session_local, patch("app.api.onedrive.save_setting_to_db"), @@ -198,7 +198,7 @@ class TestTestTokenRotation: patch.object(settings, "onedrive_refresh_token", "old_token"), patch.object(settings, "onedrive_client_id", "cid"), patch.object(settings, "onedrive_client_secret", "sec"), - patch("app.api.onedrive.os.path.exists", return_value=False), + patch("app.utils.env_utils.os.path.exists", return_value=False), patch("app.database.SessionLocal", side_effect=Exception("DB error")), ): response = client.get("/api/onedrive/test-token") @@ -277,8 +277,8 @@ class TestTokenRotationEnvAppendLine: patch.object(settings, "onedrive_refresh_token", "old_token"), patch.object(settings, "onedrive_client_id", "cid"), patch.object(settings, "onedrive_client_secret", "sec"), - patch("app.api.onedrive.os.path.join", return_value=str(env_file)), - patch("app.api.onedrive.os.path.exists", return_value=True), + patch("app.utils.env_utils.os.path.join", return_value=str(env_file)), + patch("app.utils.env_utils.os.path.exists", return_value=True), patch("app.database.SessionLocal") as mock_sl, patch("app.api.onedrive.save_setting_to_db"), patch("app.api.onedrive.notify_settings_updated"),