From f6dce7accb028c3048d4d37576f7d935c7022cb9 Mon Sep 17 00:00:00 2001 From: scarreras Date: Sat, 21 Nov 2026 20:56:50 -0300 Subject: [PATCH] test: account for Windows long-path prefix in symlink assertion --- .../+windows-symlink-path-expectation.infrastructure.md | 1 + test/unit/scan/test_folder.py | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 changelog.d/+windows-symlink-path-expectation.infrastructure.md diff --git a/changelog.d/+windows-symlink-path-expectation.infrastructure.md b/changelog.d/+windows-symlink-path-expectation.infrastructure.md new file mode 100644 index 00000000..1d052516 --- /dev/null +++ b/changelog.d/+windows-symlink-path-expectation.infrastructure.md @@ -0,0 +1 @@ +Account for the Windows long-path prefix when checking paths through internal symlinks and symlinked local roots in the unit tests. diff --git a/test/unit/scan/test_folder.py b/test/unit/scan/test_folder.py index d887eab8..130938dc 100644 --- a/test/unit/scan/test_folder.py +++ b/test/unit/scan/test_folder.py @@ -16,6 +16,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( @@ -75,6 +76,6 @@ def test_make_full_path_accepts_internal_link_and_symlinked_root(tmp_path): root_link = tmp_path / 'root-link' root_link.symlink_to(root, target_is_directory=True) - assert LocalFolder(root_link).make_full_path('link/new-file.txt') == str( - root_link / 'link' / 'new-file.txt' + assert LocalFolder(root_link).make_full_path('link/new-file.txt') == fix_windows_path_limit( + str(root_link / 'link' / 'new-file.txt') )