fix: resolve per-torrent qb save paths
This commit is contained in:
@@ -78,6 +78,35 @@ class ConfigTests(unittest.TestCase):
|
||||
Path("/local/qb/Sync"),
|
||||
)
|
||||
|
||||
def test_qbittorrent_can_override_a_nested_save_path(self):
|
||||
with tempfile.TemporaryDirectory() as directory:
|
||||
root = Path(directory)
|
||||
for name in ("token", "qb-password", "syncthing-key"):
|
||||
path = root / name
|
||||
path.write_text(name, encoding="utf-8")
|
||||
os.chmod(path, 0o600)
|
||||
(root / "qb").mkdir()
|
||||
(root / "fast").mkdir()
|
||||
(root / "sync").mkdir()
|
||||
config_path = root / "client.toml"
|
||||
config_path.write_text(
|
||||
_config(root).replace(
|
||||
f'local_root = "{root / "qb"}"',
|
||||
f'local_root = "{root / "qb"}"\n'
|
||||
"local_path_overrides = { \"/downloads/fast\" = "
|
||||
f'"{root / "fast"}" }}',
|
||||
1,
|
||||
),
|
||||
encoding="utf-8",
|
||||
)
|
||||
config = ClientConfig.load(config_path)
|
||||
self.assertEqual(
|
||||
config.qbittorrent.roots.api_to_local(
|
||||
"/downloads/fast/resource/file.bin"
|
||||
),
|
||||
root / "fast/resource/file.bin",
|
||||
)
|
||||
|
||||
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