Release SyncVito 1.0.15

This commit is contained in:
Davito committed 2026-09-29 05:08:56 +02:00
1 parent 1d0b1b2d38
commit 6c677f0161
9 files changed
+163 -10

No files matched your search

+16
View File
@@ -175,3 +175,19 @@ def test_enqueue_all_unpauses_and_runs(coordinator: SyncCoordinator) -> None:
assert not coordinator.config.settings.paused
assert len(workers) == 1
assert coordinator.running_task_id == coordinator.config.tasks[0].id
def test_failed_files_automatically_added_to_task_ignored_paths_and_persisted(
coordinator: SyncCoordinator,
) -> None:
task = coordinator.config.tasks[0]
assert task.ignored_paths == []
res = SyncResult(copied=5, errors=["Zugriff verweigert: lock.dat"], failed_relatives={"lock.dat", "sub/cache.bin"})
coordinator._on_finished(task.id, res)
assert "lock.dat" in task.ignored_paths
loaded = coordinator.config_store.load()
loaded_task = next(t for t in loaded.tasks if t.id == task.id)
assert "lock.dat" in loaded_task.ignored_paths
+52
View File
@@ -293,3 +293,55 @@ def test_concurrently_deleted_source_file_is_skipped(tmp_path: Path, monkeypatch
assert result.skipped == 1
assert not result.errors
assert not (target / "ephemeral.txt").exists()
def test_ignored_paths_are_completely_skipped(tmp_path: Path) -> None:
source = tmp_path / "source"
target = tmp_path / "target"
source.mkdir()
target.mkdir()
(source / "normal.txt").write_text("kopieren", encoding="utf-8")
(source / "locked.db").write_text("gesperrt", encoding="utf-8")
(source / "subdir").mkdir()
(source / "subdir" / "ignored_file.txt").write_text("in ordner", encoding="utf-8")
task = SyncTask(
name="IgnoredTest",
source=str(source),
target=str(target),
ignored_paths=["locked.db", "subdir/ignored_file.txt"],
)
engine = _engine(tmp_path)
result = engine.synchronize(task)
assert result.successful
assert result.copied == 1
assert (target / "normal.txt").exists()
assert not (target / "locked.db").exists()
assert not (target / "subdir" / "ignored_file.txt").exists()
def test_failed_files_added_to_failed_relatives(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
source = tmp_path / "source"
target = tmp_path / "target"
source.mkdir()
target.mkdir()
(source / "ok.txt").write_text("ok", encoding="utf-8")
(source / "fail.txt").write_text("fail", encoding="utf-8")
task = SyncTask(name="FailTest", source=str(source), target=str(target))
engine = _engine(tmp_path)
real_execute = SyncEngine._execute
def mock_execute(operation, result):
if operation.relative == "fail.txt":
raise PermissionError("Access denied")
return real_execute(operation, result)
monkeypatch.setattr(engine, "_execute", mock_execute)
result = engine.synchronize(task)
assert not result.successful
assert "fail.txt" in result.failed_relatives
assert "ok.txt" not in result.failed_relatives
assert (target / "ok.txt").exists()