fix: honor hardlinks across client mount topology

This commit is contained in:
2026-07-24 16:05:20 +00:00
parent a73bcf870f
commit 57acc90363
13 changed files with 180 additions and 18 deletions
+16 -1
View File
@@ -1,7 +1,7 @@
import os
import tempfile
import unittest
from pathlib import Path
from pathlib import Path, PurePosixPath
from unittest.mock import patch
from archive_clients.config import ClientConfig, ConfigError, RootMapping
@@ -63,6 +63,21 @@ class ConfigTests(unittest.TestCase):
with self.assertRaises(ConfigError):
mapping.api_to_local("/elsewhere/file")
def test_mapping_can_override_one_syncthing_folder_locally(self):
mapping = RootMapping(
PurePosixPath("/sync"),
Path("/local/sync"),
((PurePosixPath("/sync/DownloadsSync"), Path("/local/qb/Sync")),),
)
self.assertEqual(
mapping.api_to_local("/sync/DownloadsSync/job/ready.json"),
Path("/local/qb/Sync/job/ready.json"),
)
self.assertEqual(
mapping.local_root_for_api("/sync/DownloadsSync"),
Path("/local/qb/Sync"),
)
def test_endpoint_scheme_and_job_keys_are_strict(self):
with tempfile.TemporaryDirectory() as directory:
root = Path(directory)