feat: усилить reconciler для lab4

This commit is contained in:
2026-11-05 23:30:24 +03:00
parent a3bbdeef42
commit 1ad44408ba
11 changed files with 276 additions and 54 deletions
+2
View File
@@ -6,6 +6,7 @@ from app.tools.reconcile_attachments import AttachmentSnapshot, build_plan
def test_plan_classifies_both_sides_and_protects_fresh_items():
"""Классифицирует orphan/missing и защищает свежие расхождения."""
now = datetime.now(timezone.utc)
cutoff = now - timedelta(minutes=1)
correct_key = f'originals/{uuid4()}'
@@ -35,6 +36,7 @@ def test_plan_classifies_both_sides_and_protects_fresh_items():
def test_failed_metadata_still_protects_its_object_from_orphan_cleanup():
"""Проверяет защиту объекта существующей failed-metadata."""
now = datetime.now(timezone.utc)
key = f'originals/{uuid4()}'
failed = AttachmentSnapshot(uuid4(), key, 'failed', now - timedelta(hours=2))