From e7772b2d186b2039c090765b9063cf10d65b0459 Mon Sep 17 00:00:00 2001 From: berce <75228263+bercedev@users.noreply.github.com> Date: Wed, 14 Oct 2026 01:07:59 +0300 Subject: [PATCH] test(ingest): compare the symlink target against what readlink returned before (#4435) On Windows readlink() returns the target as \\?\C:\..., so comparing it to the plain sentinel path failed three parameters of test_binary_captures_skip_existing_entries even though the capture left the link alone. Read the target right after creating the link and compare against that, which is what "untouched" means on every platform. (cherry picked from commit eb027be62799a6d2f65ef2437ccb0166aec66fcd) --- tests/test_ingest_url_type.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test_ingest_url_type.py b/tests/test_ingest_url_type.py index c5adfeeab..9d25ba363 100644 --- a/tests/test_ingest_url_type.py +++ b/tests/test_ingest_url_type.py @@ -161,6 +161,8 @@ def test_binary_captures_skip_existing_entries(entry_kind, numbered, tmp_path, m occupied.symlink_to(sentinel) except (OSError, NotImplementedError) as exc: pytest.skip(f"host cannot create symlinks: {exc}") + # Windows reads the target back as \\?\C:\..., which never equals `sentinel`. + link_target = occupied.readlink() monkeypatch.setattr(ingest_mod, "validate_url", lambda url: url) monkeypatch.setattr(ingest_mod, "safe_fetch", lambda url: b"new capture") @@ -176,7 +178,7 @@ def test_binary_captures_skip_existing_entries(entry_kind, numbered, tmp_path, m elif entry_kind == "directory": assert occupied.is_dir() and not list(occupied.iterdir()) else: - assert occupied.is_symlink() and occupied.readlink() == sentinel + assert occupied.is_symlink() and occupied.readlink() == link_target if entry_kind == "live_link": assert sentinel.read_bytes() == b"outside sentinel" else: