Add backup recovery center

This commit is contained in:
Philip Guzman
2026-07-01 15:34:58 -07:00
parent c4f1b4535d
commit da72419ce9
9 changed files with 184 additions and 5 deletions
+7
View File
@@ -5,6 +5,7 @@ import pytest
from serato_doctor.repair import (
BACKUP_FOLDER,
apply_duplicate_repair,
list_backups,
plan_duplicate_repair,
restore_backup,
rotate_backups,
@@ -39,10 +40,16 @@ def test_duplicate_repair_backs_up_then_preserves_old_path_as_link(tmp_path):
assert any((receipt.backup / "serato-metadata").rglob("House.crate"))
assert any((receipt.backup / "serato-metadata").rglob("database V2"))
history = list_backups(serato)
assert len(history) == 1
assert history[0].status == "ready"
assert history[0].size_bytes > 0
restored = restore_backup(receipt.backup)
assert restored == (duplicate.resolve(),)
assert not duplicate.is_symlink()
assert duplicate.read_bytes() == b"duplicate"
assert list_backups(serato)[0].status == "restored"
def test_plan_rejects_keeper_outside_duplicate_group(tmp_path):
+2 -1
View File
@@ -40,12 +40,13 @@ def test_web_analysis_rejects_missing_folders(tmp_path):
def test_web_static_assets_are_declared_and_packaged():
asset_root = Path(__file__).parents[1] / "serato_doctor" / "webui"
assert set(STATIC_FILES) == {"/", "/app.css", "/app.js"}
assert set(STATIC_FILES) == {"/", "/app.css", "/recovery.css", "/app.js"}
assert all((asset_root / filename).is_file() for filename, _ in STATIC_FILES.values())
html = (asset_root / "index.html").read_text(encoding="utf-8")
assert "Missing tracks in Serato" in html
assert "Old crate references" in html
assert "Choose a diagnostic" in html
assert "Backup recovery" in html
assert 'data-detail="database_missing_tracks"' in html
assert 'data-detail="old_crate_references"' in html
assert html.count('class="info-button"') >= 10