fix(test): fix OAuth integration tests and auth redirect status code

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-02-12 13:17:26 +00:00
parent 604facf36f
commit 459e9fafc7
5 changed files with 56 additions and 60 deletions
+7 -5
View File
@@ -443,10 +443,12 @@ class TestEmbedMetadataIntoPdf:
with patch("app.tasks.embed_metadata_into_pdf.Path") as mock_path_class:
# Mock Path for deletion logic
mock_original_path = MagicMock()
mock_original_path.exists.return_value = True
mock_original_path.is_relative_to.return_value = True
mock_resolved_path = MagicMock()
mock_resolved_path.exists.return_value = True
mock_resolved_path.is_relative_to.return_value = True
mock_original_path.resolve.return_value = mock_resolved_path
mock_workdir_path = MagicMock()
mock_path_class.side_effect = [mock_workdir_path, mock_original_path, mock_workdir_path]
mock_path_class.side_effect = [mock_workdir_path, mock_original_path]
with patch("app.tasks.embed_metadata_into_pdf.os.remove"):
with patch("app.tasks.embed_metadata_into_pdf.settings") as mock_settings:
@@ -458,5 +460,5 @@ class TestEmbedMetadataIntoPdf:
"/workdir/tmp/test.pdf", "text", {"filename": "test.pdf"}, file_id=333
)
# Verify unlink (delete) was called
mock_original_path.unlink.assert_called_once()
# Verify unlink (delete) was called on the resolved path
mock_resolved_path.unlink.assert_called_once()