Release SyncVito 1.0.10
This commit is contained in:
1 parent
4efc1efa18
commit
7098fa1c0c
9 files changed
+317
-20
No files matched your search
@@ -223,3 +223,49 @@ def test_bidirectional_mirrors_known_deletion(tmp_path: Path) -> None:
|
||||
|
||||
assert result.successful
|
||||
assert not (source / "entfernen.txt").exists()
|
||||
|
||||
|
||||
def test_stage_progress_reporting_for_multiple_folders(tmp_path: Path) -> None:
|
||||
source = tmp_path / "source"
|
||||
target = tmp_path / "target"
|
||||
(source / "AppData").mkdir(parents=True)
|
||||
(source / "Documents").mkdir(parents=True)
|
||||
(source / "AppData" / "config.json").write_text("{}", encoding="utf-8")
|
||||
(source / "Documents" / "doc.txt").write_text("text", encoding="utf-8")
|
||||
task = SyncTask(name="Backup", source=str(source), target=str(target))
|
||||
|
||||
messages: list[tuple[int, str]] = []
|
||||
result = _engine(tmp_path).synchronize(task, progress=lambda v, d: messages.append((v, d)))
|
||||
|
||||
assert result.successful
|
||||
assert any("[1/2 AppData]" in detail for _, detail in messages)
|
||||
assert any("[2/2 Documents]" in detail for _, detail in messages)
|
||||
|
||||
|
||||
def test_pause_and_resume_continues_where_interrupted(tmp_path: Path) -> None:
|
||||
source = tmp_path / "source"
|
||||
target = tmp_path / "target"
|
||||
source.mkdir()
|
||||
(source / "a.txt").write_text("a", encoding="utf-8")
|
||||
(source / "b.txt").write_text("b", encoding="utf-8")
|
||||
(source / "c.txt").write_text("c", encoding="utf-8")
|
||||
task = SyncTask(name="ResumeTest", source=str(source), target=str(target))
|
||||
engine = _engine(tmp_path)
|
||||
|
||||
# 1. Unterbrechung nach der ersten Datei
|
||||
def cancel_after_one() -> bool:
|
||||
return (target / "a.txt").exists()
|
||||
|
||||
result_paused = engine.synchronize(task, cancel_check=cancel_after_one)
|
||||
assert result_paused.paused
|
||||
assert not result_paused.successful
|
||||
assert (target / "a.txt").exists()
|
||||
assert not (target / "c.txt").exists()
|
||||
|
||||
# 2. Fortsetzen: Bereits kopierte Datei a.txt wird übersprungen, b und c werden kopiert
|
||||
result_resumed = engine.synchronize(task)
|
||||
assert result_resumed.successful
|
||||
assert result_resumed.copied == 2
|
||||
assert (target / "a.txt").exists()
|
||||
assert (target / "b.txt").exists()
|
||||
assert (target / "c.txt").exists()
|
||||
Reference in new issue
Block a user