fix: honor hardlinks across client mount topology
This commit is contained in:
+16
-1
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user