feat(v2): complete v2 reimplementation

This commit is contained in:
2026-07-31 13:33:39 +02:00
parent 396219e776
commit bd107d6a30
137 changed files with 20737 additions and 155 deletions
+23
View File
@@ -0,0 +1,23 @@
from __future__ import annotations
from datetime import timedelta
from pathlib import Path
from unittest.mock import patch
import pytest
from backup_tool.gc import purge_repository
def test_gc_keeps_manifest_when_unlink_fails(tmp_path: Path) -> None:
root = tmp_path / "repository"
manifest = root / "manifests" / "deleted.json"
manifest.parent.mkdir(parents=True)
manifest.write_text('{"entries": []}', encoding="utf-8")
with (
patch("pathlib.Path.unlink", side_effect=OSError("read-only")),
pytest.raises(OSError),
):
purge_repository(root, {"deleted"}, grace=timedelta(0))
assert manifest.exists()