Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Account for the Windows long-path prefix when checking paths through internal symlinks and symlinked local roots in the unit tests.
7 changes: 4 additions & 3 deletions test/unit/scan/test_folder.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

from b2sdk._internal.scan.exception import UnsupportedFilename
from b2sdk._internal.scan.folder import LocalFolder
from b2sdk._internal.utils import fix_windows_path_limit


@pytest.mark.skipif(
Expand Down Expand Up @@ -78,8 +79,8 @@ def test_make_full_path_accepts_internal_link_and_symlinked_root(tmp_path):

result = LocalFolder(root_link).make_full_path('link/new-file.txt')
expected = str(root_link / 'link' / 'new-file.txt')
# Windows symlink resolution can add an extended-length ("\\?\\") prefix that
# realpath does not normalize away, so compare by filesystem identity of the
# (existing) parent directory plus the file name instead of raw strings.
assert result == fix_windows_path_limit(expected)
# Also check the existing parent by filesystem identity: realpath alone
# does not normalize away the Windows extended-length prefix.
assert os.path.basename(result) == os.path.basename(expected) == 'new-file.txt'
assert os.path.samefile(os.path.dirname(result), os.path.dirname(expected))
Loading