fix(tests): restore correct route URLs and fix auth/exception handling broken by d221753

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
Agent-Logs-Url: https://github.com/christianlouis/DocuElevate/sessions/df99f308-d964-4732-88b7-a01be6aeee05
This commit is contained in:
copilot-swe-agent[bot]
2026-03-24 20:22:18 +00:00
parent cafc0e4523
commit 48331f6e91
8 changed files with 55 additions and 36 deletions
+3 -4
View File
@@ -490,12 +490,11 @@ class TestSaveGoogleDriveSettings:
assert response.status_code == 200
@patch("os.path.exists")
@patch("os.path.dirname")
@patch("app.api.google_drive.os")
@patch("app.config.settings")
def test_save_settings_exception_handling(self, mock_settings, mock_dirname, mock_exists, client: TestClient):
def test_save_settings_exception_handling(self, mock_settings, mock_os, client: TestClient):
"""Test that exceptions in .env write are non-fatal — DB write still succeeds."""
mock_exists.side_effect = Exception("Unexpected error")
mock_os.path.exists.side_effect = Exception("Unexpected error")
response = client.post("/api/google-drive/save-settings", data={"refresh_token": "token", "use_oauth": "true"})