From b4e93c00b47f085b6c86c8de2c8dfe8774789ea1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 26 Feb 2026 11:02:16 +0000 Subject: [PATCH] fix(tests): fix test_save_settings_outer_exception in OneDrive coverage tests The test was patching os.path.join, which is called inside an inner try/except block in save_onedrive_settings. This meant the exception was silently caught and logged, never reaching the outer exception handler that returns HTTP 500. Fix by patching notify_settings_updated instead, which is called in the outer try block, so exceptions correctly propagate to the outer handler. Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com> --- tests/test_api_onedrive_coverage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_api_onedrive_coverage.py b/tests/test_api_onedrive_coverage.py index 10f1b314..34937c77 100644 --- a/tests/test_api_onedrive_coverage.py +++ b/tests/test_api_onedrive_coverage.py @@ -296,7 +296,7 @@ class TestSaveSettingsException: def test_save_settings_outer_exception(self, client: TestClient): """Trigger the outer exception handler in save_onedrive_settings.""" - with patch("app.api.onedrive.os.path.join", side_effect=Exception("Unexpected boom")): + with patch("app.api.onedrive.notify_settings_updated", side_effect=Exception("Unexpected boom")): response = client.post( "/api/onedrive/save-settings", data={