feat(tasks): add detailed logging to upload_with_rclone task functions

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-02-11 10:06:51 +00:00
parent 14eacc7c23
commit 6f286e37b3
2 changed files with 61 additions and 17 deletions
+6 -3
View File
@@ -15,7 +15,8 @@ class TestUploadWithRclone:
with pytest.raises(FileNotFoundError):
upload_with_rclone("/nonexistent/file.pdf", "remote:path")
def test_raises_value_error_invalid_destination(self, tmp_path):
@patch("app.tasks.upload_with_rclone.log_task_progress")
def test_raises_value_error_invalid_destination(self, mock_log, tmp_path):
"""Test raises ValueError for invalid destination format."""
test_file = tmp_path / "test.pdf"
test_file.write_bytes(b"test")
@@ -23,7 +24,8 @@ class TestUploadWithRclone:
with pytest.raises(ValueError, match="Invalid destination format"):
upload_with_rclone(str(test_file), "invalid_destination")
def test_raises_value_error_invalid_remote_name(self, tmp_path):
@patch("app.tasks.upload_with_rclone.log_task_progress")
def test_raises_value_error_invalid_remote_name(self, mock_log, tmp_path):
"""Test raises ValueError for invalid remote name."""
test_file = tmp_path / "test.pdf"
test_file.write_bytes(b"test")
@@ -31,7 +33,8 @@ class TestUploadWithRclone:
with pytest.raises(ValueError, match="Invalid remote name"):
upload_with_rclone(str(test_file), ":path")
def test_raises_value_error_no_config(self, tmp_path):
@patch("app.tasks.upload_with_rclone.log_task_progress")
def test_raises_value_error_no_config(self, mock_log, tmp_path):
"""Test raises ValueError when rclone config not found."""
test_file = tmp_path / "test.pdf"
test_file.write_bytes(b"test")