fix: move imports to module level per code review feedback
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
@@ -493,9 +493,6 @@ class TestExtractRemotePathEdgeCases:
|
|||||||
|
|
||||||
def test_windows_style_separators(self, monkeypatch):
|
def test_windows_style_separators(self, monkeypatch):
|
||||||
"""Test handling of Windows-style path separators."""
|
"""Test handling of Windows-style path separators."""
|
||||||
# Temporarily change os.sep to backslash
|
|
||||||
import os
|
|
||||||
|
|
||||||
result = extract_remote_path("/base/subdir/file.pdf", "/base", "/remote")
|
result = extract_remote_path("/base/subdir/file.pdf", "/base", "/remote")
|
||||||
# Should use forward slashes in output
|
# Should use forward slashes in output
|
||||||
assert "\\" not in result
|
assert "\\" not in result
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
import os
|
import os
|
||||||
from unittest.mock import MagicMock, Mock, patch
|
from unittest.mock import MagicMock, Mock, patch
|
||||||
|
|
||||||
|
import paramiko
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from app.tasks.upload_to_sftp import upload_to_sftp
|
from app.tasks.upload_to_sftp import upload_to_sftp
|
||||||
@@ -89,8 +90,6 @@ class TestUploadToSFTP:
|
|||||||
@patch("app.tasks.upload_to_sftp.settings")
|
@patch("app.tasks.upload_to_sftp.settings")
|
||||||
def test_upload_with_disabled_host_key_verification(self, mock_settings, mock_ssh_class, tmp_path):
|
def test_upload_with_disabled_host_key_verification(self, mock_settings, mock_ssh_class, tmp_path):
|
||||||
"""Test SFTP upload with host key verification disabled."""
|
"""Test SFTP upload with host key verification disabled."""
|
||||||
import paramiko
|
|
||||||
|
|
||||||
test_file = tmp_path / "test.pdf"
|
test_file = tmp_path / "test.pdf"
|
||||||
test_file.write_text("test content")
|
test_file.write_text("test content")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user